clean up
This commit is contained in:
parent
3a244429d5
commit
78cefbb297
53
init.lua
53
init.lua
|
@ -1,37 +1,38 @@
|
||||||
-- load plugins
|
-- load plugins
|
||||||
require('pluginsList.lua')
|
require("pluginsList.lua")
|
||||||
require('web-devicons.lua')
|
require("web-devicons.lua")
|
||||||
|
|
||||||
require('utils.lua')
|
require("utils.lua")
|
||||||
require('nvimTree.lua')
|
require("nvimTree.lua")
|
||||||
require('bufferline.lua')
|
require("bufferline.lua")
|
||||||
require('statusline.lua')
|
require("statusline.lua")
|
||||||
require('telescope-nvim.lua')
|
require("telescope-nvim.lua")
|
||||||
|
|
||||||
-- lsp
|
-- lsp
|
||||||
require('nvim-lspconfig.lua')
|
require("nvim-lspconfig.lua")
|
||||||
require('nvim-compe.lua')
|
require("nvim-compe.lua")
|
||||||
require('coc.lua')
|
require("coc.lua")
|
||||||
|
|
||||||
require('gitsigns.lua')
|
require("gitsigns.lua")
|
||||||
|
|
||||||
require'colorizer'.setup()
|
require "colorizer".setup()
|
||||||
|
|
||||||
local cmd = vim.cmd
|
local cmd = vim.cmd
|
||||||
local g = vim.g
|
local g = vim.g
|
||||||
local indent = 2
|
local indent = 2
|
||||||
|
|
||||||
cmd 'colorscheme base16-onedark'
|
cmd "colorscheme base16-onedark"
|
||||||
cmd 'syntax enable'
|
cmd "syntax enable"
|
||||||
cmd 'syntax on'
|
cmd "syntax on"
|
||||||
|
|
||||||
g.auto_save = 1
|
g.auto_save = 1
|
||||||
g.mapleader = ' '
|
|
||||||
|
|
||||||
require('treesitter.lua')
|
g.mapleader = " "
|
||||||
require('mappings.lua')
|
|
||||||
|
|
||||||
-- highlights
|
require("treesitter.lua")
|
||||||
|
require("mappings.lua")
|
||||||
|
|
||||||
|
-- highlights
|
||||||
cmd("hi LineNr guibg=NONE")
|
cmd("hi LineNr guibg=NONE")
|
||||||
cmd("hi SignColumn guibg=NONE")
|
cmd("hi SignColumn guibg=NONE")
|
||||||
cmd("hi VertSplit guibg=NONE")
|
cmd("hi VertSplit guibg=NONE")
|
||||||
|
@ -44,14 +45,16 @@ cmd("highlight TelescopeBorder guifg=#3e4451")
|
||||||
cmd("highlight TelescopePromptBorder guifg=#3e4451")
|
cmd("highlight TelescopePromptBorder guifg=#3e4451")
|
||||||
cmd("highlight TelescopeResultsBorder guifg=#3e4451")
|
cmd("highlight TelescopeResultsBorder guifg=#3e4451")
|
||||||
cmd("highlight TelescopePreviewBorder guifg=#525865")
|
cmd("highlight TelescopePreviewBorder guifg=#525865")
|
||||||
cmd("highlight PmenuSel guibg=#BBE67E")
|
cmd("highlight PmenuSel guibg=#98c379")
|
||||||
|
|
||||||
-- tree folder name , icon color
|
-- tree folder name , icon color
|
||||||
cmd("highlight NvimTreeFolderIcon guifg = #61afef")
|
cmd("highlight NvimTreeFolderIcon guifg = #61afef")
|
||||||
cmd("highlight NvimTreeFolderName guifg = #61afef")
|
cmd("highlight NvimTreeFolderName guifg = #61afef")
|
||||||
|
|
||||||
require('nvim-autopairs').setup()
|
require("nvim-autopairs").setup()
|
||||||
|
|
||||||
require('lspkind').init({
|
require("lspkind").init(
|
||||||
File = ' ',
|
{
|
||||||
})
|
File = " "
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -1,54 +1,53 @@
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
require'bufferline'.setup{
|
require "bufferline".setup {
|
||||||
options = {
|
options = {
|
||||||
buffer_close_icon= '',
|
buffer_close_icon = "",
|
||||||
modified_icon = '●',
|
modified_icon = "●",
|
||||||
close_icon = '',
|
close_icon = "",
|
||||||
left_trunc_marker = '',
|
left_trunc_marker = "",
|
||||||
right_trunc_marker = '',
|
right_trunc_marker = "",
|
||||||
max_name_length = 14,
|
max_name_length = 14,
|
||||||
max_prefix_length = 13,
|
max_prefix_length = 13,
|
||||||
tab_size = 18,
|
tab_size = 18,
|
||||||
enforce_regular_tabs = true ,
|
enforce_regular_tabs = true,
|
||||||
view = "multiwindow" ,
|
view = "multiwindow",
|
||||||
show_buffer_close_icons = true ,
|
show_buffer_close_icons = true,
|
||||||
separator_style = "thin"
|
separator_style = "thin"
|
||||||
},
|
},
|
||||||
|
highlights = {
|
||||||
highlights = {
|
|
||||||
background = {
|
background = {
|
||||||
guifg = comment_fg,
|
guifg = comment_fg,
|
||||||
guibg = '#282c34'
|
guibg = "#282c34"
|
||||||
},
|
},
|
||||||
fill = {
|
fill = {
|
||||||
guifg = comment_fg,
|
guifg = comment_fg,
|
||||||
guibg = '#282c34'
|
guibg = "#282c34"
|
||||||
},
|
},
|
||||||
buffer_selected = {
|
buffer_selected = {
|
||||||
guifg = normal_fg,
|
guifg = normal_fg,
|
||||||
guibg = '#3A3E44',
|
guibg = "#3A3E44",
|
||||||
gui = "bold"
|
gui = "bold"
|
||||||
},
|
},
|
||||||
separator_visible = {
|
separator_visible = {
|
||||||
guifg = '#282c34' ,
|
guifg = "#282c34",
|
||||||
guibg = '#282c34'
|
guibg = "#282c34"
|
||||||
},
|
},
|
||||||
separator_selected = {
|
separator_selected = {
|
||||||
guifg = '#282c34' ,
|
guifg = "#282c34",
|
||||||
guibg = '#282c34'
|
guibg = "#282c34"
|
||||||
},
|
},
|
||||||
separator = {
|
separator = {
|
||||||
guifg = '#282c34' ,
|
guifg = "#282c34",
|
||||||
guibg = '#282c34'
|
guibg = "#282c34"
|
||||||
},
|
},
|
||||||
indicator_selected = {
|
indicator_selected = {
|
||||||
guifg = '#282c34' ,
|
guifg = "#282c34",
|
||||||
guibg = '#282c34'
|
guibg = "#282c34"
|
||||||
},
|
},
|
||||||
modified_selected = {
|
modified_selected = {
|
||||||
guifg = string_fg,
|
guifg = string_fg,
|
||||||
guibg = '#3A3E44'
|
guibg = "#3A3E44"
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,27 @@
|
||||||
require('gitsigns').setup {
|
require("gitsigns").setup {
|
||||||
signs = {
|
signs = {
|
||||||
add = {hl = 'DiffAdd' , text = '▌', numhl='GitSignsAddNr'},
|
add = {hl = "DiffAdd", text = "▌", numhl = "GitSignsAddNr"},
|
||||||
change = {hl = 'DiffChange', text = '▌', numhl='GitSignsChangeNr'},
|
change = {hl = "DiffChange", text = "▌", numhl = "GitSignsChangeNr"},
|
||||||
delete = {hl = 'DiffDelete', text = '_', numhl='GitSignsDeleteNr'},
|
delete = {hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr"},
|
||||||
topdelete = {hl = 'DiffDelete', text = '‾', numhl='GitSignsDeleteNr'},
|
topdelete = {hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr"},
|
||||||
changedelete = {hl = 'DiffChange', text = '~', numhl='GitSignsChangeNr'},
|
changedelete = {hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr"}
|
||||||
},
|
},
|
||||||
numhl = false,
|
numhl = false,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
-- Default keymap options
|
-- Default keymap options
|
||||||
noremap = true,
|
noremap = true,
|
||||||
buffer = true,
|
buffer = true,
|
||||||
|
["n ]c"] = {expr = true, '&diff ? \']c\' : \'<cmd>lua require"gitsigns".next_hunk()<CR>\''},
|
||||||
['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'"},
|
["n [c"] = {expr = true, '&diff ? \'[c\' : \'<cmd>lua require"gitsigns".prev_hunk()<CR>\''},
|
||||||
['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'"},
|
["n <leader>hs"] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
||||||
|
["n <leader>hu"] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
||||||
['n <leader>hs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
["n <leader>hr"] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
||||||
['n <leader>hu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
["n <leader>hp"] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
||||||
['n <leader>hr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
["n <leader>hb"] = '<cmd>lua require"gitsigns".blame_line()<CR>'
|
||||||
['n <leader>hp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
},
|
||||||
['n <leader>hb'] = '<cmd>lua require"gitsigns".blame_line()<CR>',
|
watch_index = {
|
||||||
},
|
interval = 100
|
||||||
watch_index = {
|
},
|
||||||
interval = 100
|
sign_priority = 5,
|
||||||
},
|
status_formatter = nil -- Use default
|
||||||
sign_priority = 5,
|
|
||||||
status_formatter = nil, -- Use default
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,19 +5,18 @@ vim.cmd [[ packadd completion-nvim ]]
|
||||||
local html_snippet_capabilities = vim.lsp.protocol.make_client_capabilities()
|
local html_snippet_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
html_snippet_capabilities.textDocument.completion.completionItem.snippetSupport = true
|
html_snippet_capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
|
||||||
require'lspconfig'.html.setup {
|
require "lspconfig".html.setup {
|
||||||
on_attach = lsp_on_attach,
|
on_attach = lsp_on_attach,
|
||||||
capabilities = html_snippet_capabilities,
|
capabilities = html_snippet_capabilities,
|
||||||
cmd = { "html-languageserver", "--stdio" };
|
cmd = {"html-languageserver", "--stdio"},
|
||||||
filetypes = { "html" };
|
filetypes = {"html"},
|
||||||
init_opitons = {
|
init_opitons = {
|
||||||
configurationSection = { "html", "css", "javascript" };
|
configurationSection = {"html", "css", "javascript"},
|
||||||
embeddedLanguages = {
|
embeddedLanguages = {
|
||||||
css = true,
|
css = true,
|
||||||
javascript = true,
|
javascript = true
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.g.completion_enable_snippet = 'UltiSnips'
|
vim.g.completion_enable_snippet = "UltiSnips"
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
local function map(mode, lhs, rhs, opts)
|
local function map(mode, lhs, rhs, opts)
|
||||||
local options = {noremap = true}
|
local options = {noremap = true}
|
||||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
if opts then
|
||||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
options = vim.tbl_extend("force", options, opts)
|
||||||
|
end
|
||||||
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- keybind list
|
-- keybind list
|
||||||
map('', '<leader>c', '"+y')
|
map("", "<leader>c", '"+y')
|
||||||
|
|
||||||
|
|
|
@ -3,45 +3,44 @@ vim.cmd [[packadd nvim-compe]]
|
||||||
|
|
||||||
vim.o.completeopt = "menuone,noselect"
|
vim.o.completeopt = "menuone,noselect"
|
||||||
|
|
||||||
require'compe'.setup {
|
require "compe".setup {
|
||||||
enabled = true;
|
enabled = true,
|
||||||
autocomplete = true;
|
autocomplete = true,
|
||||||
debug = false;
|
debug = false,
|
||||||
min_length = 1;
|
min_length = 1,
|
||||||
preselect = 'enable';
|
preselect = "enable",
|
||||||
throttle_time = 80;
|
throttle_time = 80,
|
||||||
source_timeout = 200;
|
source_timeout = 200,
|
||||||
incomplete_delay = 400;
|
incomplete_delay = 400,
|
||||||
max_abbr_width = 100;
|
max_abbr_width = 100,
|
||||||
max_kind_width = 100;
|
max_kind_width = 100,
|
||||||
max_menu_width = 100;
|
max_menu_width = 100,
|
||||||
documentation = false;
|
documentation = false,
|
||||||
|
source = {
|
||||||
source = {
|
path = true,
|
||||||
path = true;
|
buffer = true,
|
||||||
buffer = true;
|
calc = true,
|
||||||
calc = true;
|
vsnip = true,
|
||||||
vsnip = true;
|
nvim_lsp = true,
|
||||||
nvim_lsp = true;
|
nvim_lua = true,
|
||||||
nvim_lua = true;
|
spell = true,
|
||||||
spell = true;
|
tags = true,
|
||||||
tags = true;
|
snippets_nvim = true,
|
||||||
snippets_nvim = true;
|
treesitter = true
|
||||||
treesitter = true;
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local t = function(str)
|
local t = function(str)
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
end
|
end
|
||||||
_G.s_tab_complete = function()
|
_G.s_tab_complete = function()
|
||||||
if vim.fn.pumvisible() == 1 then
|
if vim.fn.pumvisible() == 1 then
|
||||||
return t "<C-p>"
|
return t "<C-p>"
|
||||||
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
||||||
return t "<Plug>(vsnip-jump-prev)"
|
return t "<Plug>(vsnip-jump-prev)"
|
||||||
else
|
else
|
||||||
return t "<S-Tab>"
|
return t "<S-Tab>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
|
|
|
@ -2,31 +2,33 @@ vim.cmd [[packadd nvim-lspconfig]]
|
||||||
vim.cmd [[packadd nvim-compe]]
|
vim.cmd [[packadd nvim-compe]]
|
||||||
|
|
||||||
local function map(mode, lhs, rhs, opts)
|
local function map(mode, lhs, rhs, opts)
|
||||||
local options = {noremap = true}
|
local options = {noremap = true}
|
||||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
if opts then
|
||||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
options = vim.tbl_extend("force", options, opts)
|
||||||
|
end
|
||||||
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
local opts = { noremap=true, silent=true }
|
local opts = {noremap = true, silent = true}
|
||||||
|
|
||||||
-- Mappings.
|
-- Mappings.
|
||||||
map('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||||
map('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
map("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||||
map('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||||
|
|
||||||
map('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||||
map('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||||
map('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
map("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||||
map('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
map("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||||
map('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
map("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||||
map('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
map("n", "<space>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
|
||||||
map('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
map("n", "<space>D", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||||
map('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
map("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||||
map('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
map("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||||
map('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
map("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||||
map('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
map("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||||
map('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
map("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||||
|
|
||||||
require'lspconfig'.tsserver.setup{}
|
require "lspconfig".tsserver.setup {}
|
||||||
require'lspconfig'.cssls.setup{}
|
require "lspconfig".cssls.setup {}
|
||||||
require'lspconfig'.html.setup{}
|
require "lspconfig".html.setup {}
|
||||||
|
|
|
@ -1,80 +1,84 @@
|
||||||
vim.cmd [[packadd nvim-tree.lua]]
|
vim.cmd [[packadd nvim-tree.lua]]
|
||||||
|
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
vim.g.nvim_tree_side = 'left'
|
vim.g.nvim_tree_side = "left"
|
||||||
vim.g.nvim_tree_width = 24
|
vim.g.nvim_tree_width = 24
|
||||||
vim.g.nvim_tree_ignore = { '.git', 'node_modules', '.cache' }
|
vim.g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
|
||||||
vim.g.nvim_tree_auto_open = 0
|
vim.g.nvim_tree_auto_open = 0
|
||||||
vim.g.nvim_tree_auto_close = 0
|
vim.g.nvim_tree_auto_close = 0
|
||||||
vim.g.nvim_tree_quit_on_open = 0
|
vim.g.nvim_tree_quit_on_open = 0
|
||||||
vim.g.nvim_tree_follow = 1
|
vim.g.nvim_tree_follow = 1
|
||||||
vim.g.nvim_tree_indent_markers = 1
|
vim.g.nvim_tree_indent_markers = 1
|
||||||
vim.g.nvim_tree_hide_dotfiles = 1
|
vim.g.nvim_tree_hide_dotfiles = 1
|
||||||
vim.g.nvim_tree_git_hl = 1
|
vim.g.nvim_tree_git_hl = 1
|
||||||
vim.g.nvim_tree_root_folder_modifier = ':~'
|
vim.g.nvim_tree_root_folder_modifier = ":~"
|
||||||
vim.g.nvim_tree_tab_open = 1
|
vim.g.nvim_tree_tab_open = 1
|
||||||
vim.g.nvim_tree_allow_resize = 1
|
vim.g.nvim_tree_allow_resize = 1
|
||||||
|
|
||||||
vim.g.nvim_tree_show_icons = {
|
vim.g.nvim_tree_show_icons = {
|
||||||
git = 1,
|
git = 1,
|
||||||
folders = 1,
|
folders = 1,
|
||||||
files = 1,
|
files = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.g.nvim_tree_icons = {
|
vim.g.nvim_tree_icons = {
|
||||||
default = ' ',
|
default = " ",
|
||||||
symlink = ' ',
|
symlink = " ",
|
||||||
|
git = {
|
||||||
|
unstaged = "✗",
|
||||||
|
staged = "✓",
|
||||||
|
unmerged = "",
|
||||||
|
renamed = "➜",
|
||||||
|
untracked = "★"
|
||||||
|
},
|
||||||
|
folder = {
|
||||||
|
default = "",
|
||||||
|
open = "",
|
||||||
|
symlink = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
git = {
|
local get_lua_cb = function(cb_name)
|
||||||
unstaged = "✗",
|
return string.format(":lua require'nvim-tree'.on_keypress('%s')<CR>", cb_name)
|
||||||
staged = "✓",
|
|
||||||
unmerged = "",
|
|
||||||
renamed = "➜",
|
|
||||||
untracked = "★"
|
|
||||||
},
|
|
||||||
folder = {
|
|
||||||
default = "",
|
|
||||||
open = "",
|
|
||||||
symlink = "",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local get_lua_cb = function (cb_name)
|
|
||||||
return string.format(":lua require'nvim-tree'.on_keypress('%s')<CR>", cb_name)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Mappings for nvimtree
|
-- Mappings for nvimtree
|
||||||
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-n>', ':NvimTreeToggle<CR>', {
|
vim.api.nvim_set_keymap(
|
||||||
noremap = true,
|
"n",
|
||||||
silent = true
|
"<C-n>",
|
||||||
})
|
":NvimTreeToggle<CR>",
|
||||||
|
{
|
||||||
|
noremap = true,
|
||||||
|
silent = true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
vim.g.nvim_tree_bindings = {
|
vim.g.nvim_tree_bindings = {
|
||||||
["<CR>"] = get_lua_cb("edit"),
|
["<CR>"] = get_lua_cb("edit"),
|
||||||
["o"] = get_lua_cb("edit"),
|
["o"] = get_lua_cb("edit"),
|
||||||
["<2-LeftMouse>"] = get_lua_cb("edit"),
|
["<2-LeftMouse>"] = get_lua_cb("edit"),
|
||||||
["<2-RightMouse>"] = get_lua_cb("cd"),
|
["<2-RightMouse>"] = get_lua_cb("cd"),
|
||||||
["<C-]>"] = get_lua_cb("cd"),
|
["<C-]>"] = get_lua_cb("cd"),
|
||||||
["<C-v>"] = get_lua_cb("vsplit"),
|
["<C-v>"] = get_lua_cb("vsplit"),
|
||||||
["<C-x>"] = get_lua_cb("split"),
|
["<C-x>"] = get_lua_cb("split"),
|
||||||
["<C-t>"] = get_lua_cb("tabnew"),
|
["<C-t>"] = get_lua_cb("tabnew"),
|
||||||
["<BS>"] = get_lua_cb("close_node"),
|
["<BS>"] = get_lua_cb("close_node"),
|
||||||
["<S-CR>"] = get_lua_cb("close_node"),
|
["<S-CR>"] = get_lua_cb("close_node"),
|
||||||
["<Tab>"] = get_lua_cb("preview"),
|
["<Tab>"] = get_lua_cb("preview"),
|
||||||
["I"] = get_lua_cb("toggle_ignored"),
|
["I"] = get_lua_cb("toggle_ignored"),
|
||||||
["H"] = get_lua_cb("toggle_dotfiles"),
|
["H"] = get_lua_cb("toggle_dotfiles"),
|
||||||
["R"] = get_lua_cb("refresh"),
|
["R"] = get_lua_cb("refresh"),
|
||||||
["a"] = get_lua_cb("create"),
|
["a"] = get_lua_cb("create"),
|
||||||
["d"] = get_lua_cb("remove"),
|
["d"] = get_lua_cb("remove"),
|
||||||
["r"] = get_lua_cb("rename"),
|
["r"] = get_lua_cb("rename"),
|
||||||
["<C-r>"] = get_lua_cb("full_rename"),
|
["<C-r>"] = get_lua_cb("full_rename"),
|
||||||
["x"] = get_lua_cb("cut"),
|
["x"] = get_lua_cb("cut"),
|
||||||
["c"] = get_lua_cb("copy"),
|
["c"] = get_lua_cb("copy"),
|
||||||
["p"] = get_lua_cb("paste"),
|
["p"] = get_lua_cb("paste"),
|
||||||
["[c"] = get_lua_cb("prev_git_item"),
|
["[c"] = get_lua_cb("prev_git_item"),
|
||||||
["]c"] = get_lua_cb("next_git_item"),
|
["]c"] = get_lua_cb("next_git_item"),
|
||||||
["-"] = get_lua_cb("dir_up"),
|
["-"] = get_lua_cb("dir_up"),
|
||||||
["q"] = get_lua_cb("close"),
|
["q"] = get_lua_cb("close")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +1,30 @@
|
||||||
-- check if packer is installed (~/local/share/nvim/site/pack)
|
-- check if packer is installed (~/local/share/nvim/site/pack)
|
||||||
local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]])
|
local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]])
|
||||||
|
|
||||||
return require('packer').startup(function()
|
return require("packer").startup(
|
||||||
use {'wbthomason/packer.nvim', opt = true}
|
function()
|
||||||
use { 'kyazdani42/nvim-web-devicons'}
|
use {"wbthomason/packer.nvim", opt = true}
|
||||||
use { 'kyazdani42/nvim-tree.lua'}
|
use {"kyazdani42/nvim-web-devicons"}
|
||||||
use { 'nvim-lua/plenary.nvim'}
|
use {"kyazdani42/nvim-tree.lua"}
|
||||||
use { 'lewis6991/gitsigns.nvim'}
|
use {"nvim-lua/plenary.nvim"}
|
||||||
use { 'glepnir/galaxyline.nvim'}
|
use {"lewis6991/gitsigns.nvim"}
|
||||||
use { 'akinsho/nvim-bufferline.lua'}
|
use {"glepnir/galaxyline.nvim"}
|
||||||
use { '907th/vim-auto-save'}
|
use {"akinsho/nvim-bufferline.lua"}
|
||||||
use { 'nvim-treesitter/nvim-treesitter'}
|
use {"907th/vim-auto-save"}
|
||||||
use { 'chriskempson/base16-vim'}
|
use {"nvim-treesitter/nvim-treesitter"}
|
||||||
use { 'norcalli/nvim-colorizer.lua'}
|
use {"chriskempson/base16-vim"}
|
||||||
use { 'ryanoasis/vim-devicons'}
|
use {"norcalli/nvim-colorizer.lua"}
|
||||||
use { 'sbdchd/neoformat'}
|
-- use { 'Yggdroot/indentLine'}
|
||||||
use { 'neovim/nvim-lspconfig'}
|
use {"ryanoasis/vim-devicons"}
|
||||||
use { 'hrsh7th/nvim-compe'}
|
use {"sbdchd/neoformat"}
|
||||||
use { 'windwp/nvim-autopairs'}
|
use {"neovim/nvim-lspconfig"}
|
||||||
use { 'alvan/vim-closetag'}
|
use {"hrsh7th/nvim-compe"}
|
||||||
use { 'tweekmonster/startuptime.vim'}
|
use {"windwp/nvim-autopairs"}
|
||||||
use {'onsails/lspkind-nvim'}
|
use {"alvan/vim-closetag"}
|
||||||
use { 'nvim-telescope/telescope.nvim'}
|
use {"tweekmonster/startuptime.vim"}
|
||||||
use {'nvim-telescope/telescope-media-files.nvim'}
|
use {"onsails/lspkind-nvim"}
|
||||||
use {'nvim-lua/popup.nvim'}
|
use {"nvim-telescope/telescope.nvim"}
|
||||||
end)
|
use {"nvim-telescope/telescope-media-files.nvim"}
|
||||||
|
use {"nvim-lua/popup.nvim"}
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
|
@ -1,191 +1,204 @@
|
||||||
local gl = require('galaxyline')
|
local gl = require("galaxyline")
|
||||||
local gls = gl.section
|
local gls = gl.section
|
||||||
gl.short_line_list = {'LuaTree','vista','dbui'}
|
gl.short_line_list = {"LuaTree", "vista", "dbui"}
|
||||||
|
|
||||||
local colors = {
|
local colors = {
|
||||||
bg = '#282c34',
|
bg = "#282c34",
|
||||||
line_bg = '#282c34',
|
line_bg = "#282c34",
|
||||||
fg = '#D8DEE9',
|
fg = "#D8DEE9",
|
||||||
fg_green = '#65a380',
|
fg_green = "#65a380",
|
||||||
yellow = '#A3BE8C',
|
yellow = "#A3BE8C",
|
||||||
cyan = '#22262C',
|
cyan = "#22262C",
|
||||||
darkblue = '#61afef',
|
darkblue = "#61afef",
|
||||||
green = '#BBE67E',
|
green = "#BBE67E",
|
||||||
orange = '#FF8800',
|
orange = "#FF8800",
|
||||||
purple = '#252930',
|
purple = "#252930",
|
||||||
magenta = '#c678dd',
|
magenta = "#c678dd",
|
||||||
blue = '#22262C';
|
blue = "#22262C",
|
||||||
red = '#DF8890',
|
red = "#DF8890",
|
||||||
lightbg = '#3C4048',
|
lightbg = "#3C4048",
|
||||||
nord = '#81A1C1',
|
nord = "#81A1C1",
|
||||||
greenYel = '#EBCB8B'
|
greenYel = "#EBCB8B"
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[1] = {
|
gls.left[1] = {
|
||||||
leftRounded = {
|
leftRounded = {
|
||||||
provider = function() return '' end,
|
provider = function()
|
||||||
highlight = { colors.nord, colors.bg }
|
return ""
|
||||||
},
|
end,
|
||||||
|
highlight = {colors.nord, colors.bg}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[2] = {
|
gls.left[2] = {
|
||||||
ViMode = {
|
ViMode = {
|
||||||
provider = function()
|
provider = function()
|
||||||
return ' '
|
return " "
|
||||||
end,
|
end,
|
||||||
highlight = {colors.bg,colors.nord},
|
highlight = {colors.bg, colors.nord},
|
||||||
separator = ' ',
|
separator = " ",
|
||||||
separator_highlight = {colors.lightbg,colors.lightbg},
|
separator_highlight = {colors.lightbg, colors.lightbg}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[3] ={
|
gls.left[3] = {
|
||||||
FileIcon = {
|
FileIcon = {
|
||||||
provider = 'FileIcon',
|
provider = "FileIcon",
|
||||||
condition = buffer_not_empty,
|
condition = buffer_not_empty,
|
||||||
highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.lightbg},
|
highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.lightbg}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[4] = {
|
gls.left[4] = {
|
||||||
FileName = {
|
FileName = {
|
||||||
provider = {'FileName','FileSize'},
|
provider = {"FileName", "FileSize"},
|
||||||
condition = buffer_not_empty,
|
condition = buffer_not_empty,
|
||||||
highlight = {colors.fg,colors.lightbg}
|
highlight = {colors.fg, colors.lightbg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[5] = {
|
gls.left[5] = {
|
||||||
teech = {
|
teech = {
|
||||||
provider = function() return '' end,
|
provider = function()
|
||||||
separator = ' ',
|
return ""
|
||||||
highlight = { colors.lightbg, colors.bg }
|
end,
|
||||||
},
|
separator = " ",
|
||||||
|
highlight = {colors.lightbg, colors.bg}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local checkwidth = function()
|
local checkwidth = function()
|
||||||
local squeeze_width = vim.fn.winwidth(0) / 2
|
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||||
if squeeze_width > 40 then
|
if squeeze_width > 40 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
gls.left[6] = {
|
gls.left[6] = {
|
||||||
DiffAdd = {
|
DiffAdd = {
|
||||||
provider = 'DiffAdd',
|
provider = "DiffAdd",
|
||||||
condition = checkwidth,
|
condition = checkwidth,
|
||||||
icon = ' ',
|
icon = " ",
|
||||||
highlight = {colors.greenYel,colors.line_bg},
|
highlight = {colors.greenYel, colors.line_bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[7] = {
|
gls.left[7] = {
|
||||||
DiffModified = {
|
DiffModified = {
|
||||||
provider = 'DiffModified',
|
provider = "DiffModified",
|
||||||
condition = checkwidth,
|
condition = checkwidth,
|
||||||
icon = ' ',
|
icon = " ",
|
||||||
highlight = {colors.orange,colors.line_bg},
|
highlight = {colors.orange, colors.line_bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[8] = {
|
gls.left[8] = {
|
||||||
DiffRemove = {
|
DiffRemove = {
|
||||||
provider = 'DiffRemove',
|
provider = "DiffRemove",
|
||||||
condition = checkwidth,
|
condition = checkwidth,
|
||||||
icon = ' ',
|
icon = " ",
|
||||||
highlight = {colors.red,colors.line_bg},
|
highlight = {colors.red, colors.line_bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[9] = {
|
gls.left[9] = {
|
||||||
LeftEnd = {
|
LeftEnd = {
|
||||||
provider = function() return ' ' end,
|
provider = function()
|
||||||
separator = ' ',
|
return " "
|
||||||
separator_highlight = {colors.line_bg,colors.line_bg},
|
end,
|
||||||
highlight = {colors.line_bg,colors.line_bg}
|
separator = " ",
|
||||||
}
|
separator_highlight = {colors.line_bg, colors.line_bg},
|
||||||
|
highlight = {colors.line_bg, colors.line_bg}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[10] = {
|
gls.left[10] = {
|
||||||
DiagnosticError = {
|
DiagnosticError = {
|
||||||
provider = 'DiagnosticError',
|
provider = "DiagnosticError",
|
||||||
icon = ' ',
|
icon = " ",
|
||||||
highlight = {colors.red,colors.bg}
|
highlight = {colors.red, colors.bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[11] = {
|
gls.left[11] = {
|
||||||
Space = {
|
Space = {
|
||||||
provider = function () return ' ' end,
|
provider = function()
|
||||||
highlight = {colors.line_bg,colors.line_bg}
|
return " "
|
||||||
}
|
end,
|
||||||
|
highlight = {colors.line_bg, colors.line_bg}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.left[12] = {
|
gls.left[12] = {
|
||||||
DiagnosticWarn = {
|
DiagnosticWarn = {
|
||||||
provider = 'DiagnosticWarn',
|
provider = "DiagnosticWarn",
|
||||||
icon = ' ',
|
icon = " ",
|
||||||
highlight = {colors.blue,colors.bg},
|
highlight = {colors.blue, colors.bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.right[1] = {
|
gls.right[1] = {
|
||||||
GitIcon = {
|
GitIcon = {
|
||||||
provider = function() return ' ' end,
|
provider = function()
|
||||||
condition = require('galaxyline.provider_vcs').check_git_workspace,
|
return " "
|
||||||
highlight = {colors.green,colors.line_bg},
|
end,
|
||||||
}
|
condition = require("galaxyline.provider_vcs").check_git_workspace,
|
||||||
|
highlight = {colors.green, colors.line_bg}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.right[2] = {
|
gls.right[2] = {
|
||||||
GitBranch = {
|
GitBranch = {
|
||||||
provider = 'GitBranch',
|
provider = "GitBranch",
|
||||||
condition = require('galaxyline.provider_vcs').check_git_workspace,
|
condition = require("galaxyline.provider_vcs").check_git_workspace,
|
||||||
highlight = {colors.green,colors.line_bg},
|
highlight = {colors.green, colors.line_bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.right[3] = {
|
gls.right[3] = {
|
||||||
right_LeftRounded = {
|
right_LeftRounded = {
|
||||||
provider = function() return '' end,
|
provider = function()
|
||||||
separator = ' ',
|
return ""
|
||||||
separator_highlight = {colors.bg,colors.bg},
|
end,
|
||||||
highlight = { colors.red, colors.bg }
|
separator = " ",
|
||||||
},
|
separator_highlight = {colors.bg, colors.bg},
|
||||||
|
highlight = {colors.red, colors.bg}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.right[4] = {
|
gls.right[4] = {
|
||||||
SiMode = {
|
SiMode = {
|
||||||
provider = function()
|
provider = function()
|
||||||
local alias = {
|
local alias = {
|
||||||
n = 'NORMAL',
|
n = "NORMAL",
|
||||||
i = 'INSERT',
|
i = "INSERT",
|
||||||
c = 'COMMAND',
|
c = "COMMAND",
|
||||||
V = 'VISUAL',
|
V = "VISUAL",
|
||||||
[''] = 'VISUAL',
|
[""] = "VISUAL",
|
||||||
v = 'VISUAL',
|
v = "VISUAL",
|
||||||
R = 'REPLACE',
|
R = "REPLACE"
|
||||||
}
|
}
|
||||||
return alias[vim.fn.mode()]
|
return alias[vim.fn.mode()]
|
||||||
end,
|
end,
|
||||||
highlight = { colors.bg, colors.red },
|
highlight = {colors.bg, colors.red}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gls.right[5] = {
|
gls.right[5] = {
|
||||||
PerCent = {
|
PerCent = {
|
||||||
provider = 'LinePercent',
|
provider = "LinePercent",
|
||||||
separator = ' ',
|
separator = " ",
|
||||||
separator_highlight = {colors.red,colors.red},
|
separator_highlight = {colors.red, colors.red},
|
||||||
highlight = {colors.bg,colors.fg},
|
highlight = {colors.bg, colors.fg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gls.right[6] = {
|
gls.right[6] = {
|
||||||
rightRounded = {
|
rightRounded = {
|
||||||
provider = function() return '' end,
|
provider = function()
|
||||||
highlight = { colors.fg, colors.bg }
|
return ""
|
||||||
},
|
end,
|
||||||
|
highlight = {colors.fg, colors.bg}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,72 +1,73 @@
|
||||||
require('telescope').setup{
|
require("telescope").setup {
|
||||||
|
defaults = {
|
||||||
defaults = {
|
vimgrep_arguments = {
|
||||||
vimgrep_arguments = {
|
"rg",
|
||||||
'rg',
|
"--color=never",
|
||||||
'--color=never',
|
"--no-heading",
|
||||||
'--no-heading',
|
"--with-filename",
|
||||||
'--with-filename',
|
"--line-number",
|
||||||
'--line-number',
|
"--column",
|
||||||
'--column',
|
"--smart-case"
|
||||||
'--smart-case'
|
},
|
||||||
|
prompt_position = "bottom",
|
||||||
|
prompt_prefix = "> ",
|
||||||
|
selection_caret = "> ",
|
||||||
|
entry_prefix = " ",
|
||||||
|
initial_mode = "insert",
|
||||||
|
selection_strategy = "reset",
|
||||||
|
sorting_strategy = "descending",
|
||||||
|
layout_strategy = "horizontal",
|
||||||
|
layout_defaults = {
|
||||||
|
horizontal = {
|
||||||
|
mirror = false,
|
||||||
|
preview_width = 0.5
|
||||||
|
},
|
||||||
|
vertical = {
|
||||||
|
mirror = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
file_sorter = require "telescope.sorters".get_fuzzy_file,
|
||||||
|
file_ignore_patterns = {},
|
||||||
|
generic_sorter = require "telescope.sorters".get_generic_fuzzy_sorter,
|
||||||
|
shorten_path = true,
|
||||||
|
winblend = 0,
|
||||||
|
width = 0.75,
|
||||||
|
preview_cutoff = 120,
|
||||||
|
results_height = 1,
|
||||||
|
results_width = 0.8,
|
||||||
|
border = {},
|
||||||
|
borderchars = {"─", "│", "─", "│", "╭", "╮", "╯", "╰"},
|
||||||
|
color_devicons = true,
|
||||||
|
use_less = true,
|
||||||
|
set_env = {["COLORTERM"] = "truecolor"}, -- default = nil,
|
||||||
|
file_previewer = require "telescope.previewers".vim_buffer_cat.new,
|
||||||
|
grep_previewer = require "telescope.previewers".vim_buffer_vimgrep.new,
|
||||||
|
qflist_previewer = require "telescope.previewers".vim_buffer_qflist.new,
|
||||||
|
-- Developer configurations: Not meant for general override
|
||||||
|
buffer_previewer_maker = require "telescope.previewers".buffer_previewer_maker
|
||||||
},
|
},
|
||||||
prompt_position = "bottom",
|
extensions = {
|
||||||
prompt_prefix = "> ",
|
media_files = {
|
||||||
selection_caret = "> ",
|
filetypes = {"png", "webp", "jpg", "jpeg"},
|
||||||
entry_prefix = " ",
|
find_cmd = "rg" -- find command (defaults to `fd`)
|
||||||
initial_mode = "insert",
|
}
|
||||||
selection_strategy = "reset",
|
|
||||||
sorting_strategy = "descending",
|
|
||||||
layout_strategy = "horizontal",
|
|
||||||
layout_defaults = {
|
|
||||||
horizontal = {
|
|
||||||
mirror = false,
|
|
||||||
preview_width = 0.5,
|
|
||||||
},
|
|
||||||
vertical = {
|
|
||||||
mirror = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
file_sorter = require'telescope.sorters'.get_fuzzy_file,
|
|
||||||
file_ignore_patterns = {},
|
|
||||||
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
|
|
||||||
shorten_path = true,
|
|
||||||
winblend = 0,
|
|
||||||
width = 0.75,
|
|
||||||
preview_cutoff = 120,
|
|
||||||
results_height = 1,
|
|
||||||
results_width = 0.8,
|
|
||||||
border = {},
|
|
||||||
borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' },
|
|
||||||
color_devicons = true,
|
|
||||||
use_less = true,
|
|
||||||
set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
|
|
||||||
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
|
|
||||||
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
|
|
||||||
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
|
|
||||||
|
|
||||||
-- Developer configurations: Not meant for general override
|
|
||||||
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker
|
|
||||||
},
|
|
||||||
|
|
||||||
extensions = {
|
|
||||||
media_files = {
|
|
||||||
filetypes = {"png", "webp", "jpg", "jpeg"},
|
|
||||||
find_cmd = "rg" -- find command (defaults to `fd`)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
require("telescope").load_extension("media_files")
|
||||||
|
|
||||||
require('telescope').load_extension('media_files')
|
local opt = {noremap = true, silent = true}
|
||||||
|
|
||||||
local opt = { noremap = true, silent = true }
|
vim.g.mapleader = " "
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>ff", [[<Cmd>lua require('telescope.builtin').find_files()<CR>]], opt)
|
||||||
vim.g.mapleader = ' '
|
vim.api.nvim_set_keymap(
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>ff', [[<Cmd>lua require('telescope.builtin').find_files()<CR>]], opt)
|
"n",
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>fp', [[<Cmd>lua require('telescope').extensions.media_files.media_files()<CR>]], opt)
|
"<Leader>fp",
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>fb', [[<Cmd>lua require('telescope.builtin').buffers()<CR>]], opt)
|
[[<Cmd>lua require('telescope').extensions.media_files.media_files()<CR>]],
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>fh', [[<Cmd>lua require('telescope.builtin').help_tags()<CR>]], opt)
|
opt
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>fo', [[<Cmd>lua require('telescope.builtin').oldfiles()<CR>]], opt)
|
)
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>fm', [[<Cmd> Neoformat<CR>]] , opt)
|
vim.api.nvim_set_keymap("n", "<Leader>fb", [[<Cmd>lua require('telescope.builtin').buffers()<CR>]], opt)
|
||||||
vim.api.nvim_set_keymap('n', '<C-a>', [[ <Cmd> %y+<CR>]] , opt)
|
vim.api.nvim_set_keymap("n", "<Leader>fh", [[<Cmd>lua require('telescope.builtin').help_tags()<CR>]], opt)
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fo", [[<Cmd>lua require('telescope.builtin').oldfiles()<CR>]], opt)
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fm", [[<Cmd> Neoformat<CR>]], opt)
|
||||||
|
vim.api.nvim_set_keymap("n", "<C-a>", [[ <Cmd> %y+<CR>]], opt)
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
local ts_config = require("nvim-treesitter.configs")
|
local ts_config = require("nvim-treesitter.configs")
|
||||||
|
|
||||||
ts_config.setup {
|
ts_config.setup {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"javascript","html","css","bash","cpp","rust","lua"
|
"javascript",
|
||||||
},
|
"html",
|
||||||
|
"css",
|
||||||
highlight = {
|
"bash",
|
||||||
enable = true,
|
"cpp",
|
||||||
use_languagetree = true,
|
"rust",
|
||||||
},
|
"lua"
|
||||||
|
},
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
use_languagetree = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,36 +1,37 @@
|
||||||
local scopes = { o = vim.o, b = vim.bo, w = vim.wo}
|
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
|
||||||
|
|
||||||
local function opt(scope, key, value)
|
local function opt(scope, key, value)
|
||||||
scopes[scope][key] = value
|
scopes[scope][key] = value
|
||||||
if scope ~= 'o' then scopes['o'][key] = value end
|
if scope ~= "o" then
|
||||||
|
scopes["o"][key] = value
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
opt('o', 'hidden', true)
|
opt("o", "hidden", true)
|
||||||
opt('o', 'ignorecase', true)
|
opt("o", "ignorecase", true)
|
||||||
opt('o', 'splitbelow', true)
|
opt("o", "splitbelow", true)
|
||||||
opt('o', 'splitright', true)
|
opt("o", "splitright", true)
|
||||||
opt('o', 'termguicolors', true)
|
opt("o", "termguicolors", true)
|
||||||
opt('w', 'number', true)
|
opt("w", "number", true)
|
||||||
opt('o', 'numberwidth' , 2)
|
opt("o", "numberwidth", 2)
|
||||||
|
|
||||||
opt('o' ,'mouse' , "a")
|
opt("o", "mouse", "a")
|
||||||
|
|
||||||
opt('w', 'signcolumn' , "yes")
|
|
||||||
opt('o' , 'cmdheight' , 1)
|
|
||||||
opt('o' , 'updatetime' , 250)
|
|
||||||
opt('o' , 'clipboard' , 'unnamedplus')
|
|
||||||
|
|
||||||
|
opt("w", "signcolumn", "yes")
|
||||||
|
opt("o", "cmdheight", 1)
|
||||||
|
opt("o", "updatetime", 250)
|
||||||
|
opt("o", "clipboard", "unnamedplus")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.is_buffer_empty()
|
function M.is_buffer_empty()
|
||||||
-- Check whether the current buffer is empty
|
-- Check whether the current buffer is empty
|
||||||
return vim.fn.empty(vim.fn.expand('%:t')) == 1
|
return vim.fn.empty(vim.fn.expand("%:t")) == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.has_width_gt(cols)
|
function M.has_width_gt(cols)
|
||||||
-- Check if the windows width is greater than a given number of columns
|
-- Check if the windows width is greater than a given number of columns
|
||||||
return vim.fn.winwidth(0) / 2 > cols
|
return vim.fn.winwidth(0) / 2 > cols
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -1,64 +1,61 @@
|
||||||
vim.cmd [[packadd nvim-web-devicons]]
|
vim.cmd [[packadd nvim-web-devicons]]
|
||||||
|
|
||||||
require'nvim-web-devicons'.setup {
|
require "nvim-web-devicons".setup {
|
||||||
|
override = {
|
||||||
override = {
|
html = {
|
||||||
html = {
|
icon = "",
|
||||||
icon = "",
|
color = "#DE8C92",
|
||||||
color = "#DE8C92",
|
name = "html"
|
||||||
name = "html"
|
},
|
||||||
},
|
css = {
|
||||||
css = {
|
icon = "",
|
||||||
icon = "",
|
color = "#61afef",
|
||||||
color = "#61afef",
|
name = "css"
|
||||||
name = "css"
|
},
|
||||||
},
|
js = {
|
||||||
js = {
|
icon = "",
|
||||||
icon = "",
|
color = "#EBCB8B",
|
||||||
color = "#EBCB8B",
|
name = "js"
|
||||||
name = "js"
|
},
|
||||||
},
|
png = {
|
||||||
png = {
|
icon = " ",
|
||||||
icon = " ",
|
color = "#BD77DC",
|
||||||
color = "#BD77DC",
|
name = "png"
|
||||||
name = "png"
|
},
|
||||||
},
|
jpg = {
|
||||||
jpg = {
|
icon = " ",
|
||||||
icon = " ",
|
color = "#BD77DC",
|
||||||
color = "#BD77DC",
|
name = "jpg"
|
||||||
name = "jpg"
|
},
|
||||||
},
|
jpeg = {
|
||||||
jpeg = {
|
icon = " ",
|
||||||
icon = " ",
|
color = "#BD77DC",
|
||||||
color = "#BD77DC",
|
name = "jpeg"
|
||||||
name = "jpeg"
|
},
|
||||||
},
|
mp3 = {
|
||||||
mp3 = {
|
icon = "",
|
||||||
icon = "",
|
color = "#C8CCD4",
|
||||||
color = "#C8CCD4",
|
name = "mp3"
|
||||||
name = "mp3"
|
},
|
||||||
},
|
mp4 = {
|
||||||
mp4 = {
|
icon = "",
|
||||||
icon = "",
|
color = "#C8CCD4",
|
||||||
color = "#C8CCD4",
|
name = "mp4"
|
||||||
name = "mp4"
|
},
|
||||||
},
|
out = {
|
||||||
out = {
|
icon = "",
|
||||||
icon = "",
|
color = "#C8CCD4",
|
||||||
color = "#C8CCD4",
|
name = "out"
|
||||||
name = "out"
|
},
|
||||||
},
|
toml = {
|
||||||
toml = {
|
icon = "",
|
||||||
icon = "",
|
color = "#61afef",
|
||||||
color = "#61afef",
|
name = "toml"
|
||||||
name = "toml"
|
},
|
||||||
},
|
lock = {
|
||||||
|
icon = "",
|
||||||
lock = {
|
color = "#DE6B74",
|
||||||
icon = "",
|
name = "lock"
|
||||||
color = "#DE6B74",
|
}
|
||||||
name = "lock"
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue