Cleanup Neovim ConfiNvimTreeFindFileToggleg
This commit is contained in:
parent
967e0b2af7
commit
177fc422c5
|
@ -1,31 +1,12 @@
|
|||
require('plugins')
|
||||
require('autopairs_config')
|
||||
require('settings')
|
||||
require('lsp_config')
|
||||
require('telescope_config')
|
||||
require('treesitter_config')
|
||||
require('lualine_config')
|
||||
require('mappings')
|
||||
require('trim_config')
|
||||
require('nvim_tree_config')
|
||||
|
||||
local hasleap, leap = pcall(require, 'leap')
|
||||
if hasleap then
|
||||
leap.set_default_keymaps()
|
||||
end
|
||||
|
||||
local hasComment, Comment = pcall(require, 'Comment')
|
||||
if hasComment then
|
||||
Comment.setup()
|
||||
end
|
||||
|
||||
local hastrouble, trouble = pcall(require, 'trouble')
|
||||
if hastrouble then
|
||||
trouble.setup()
|
||||
end
|
||||
|
||||
pcall(function() vim.cmd("colorscheme material") end)
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", { pattern = "make", command = [[set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab]] })
|
||||
vim.api.nvim_create_autocmd("FileType", { pattern = "vimwiki", command = [[setlocal shiftwidth=2 softtabstop=2 expandtab]] })
|
||||
vim.api.nvim_create_autocmd("FileType", { pattern = "vimwiki", command = [[setlocal filetype=markdown]] })
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
local hasnpairs, npairs = pcall(require, "nvim-autopairs")
|
||||
|
||||
if hasnpairs then
|
||||
npairs.setup {
|
||||
check_ts = true,
|
||||
}
|
||||
npairs.add_rules(require "nvim-autopairs.rules.endwise-lua")
|
||||
end
|
|
@ -4,10 +4,34 @@ if not hascmp then
|
|||
return
|
||||
end
|
||||
|
||||
local feedkey = function(key, mode)
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
||||
local select_next = function(fallback)
|
||||
if cmp.visible() then
|
||||
if require'snippy'.can_expand_or_advance() then
|
||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||
else
|
||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert })
|
||||
end
|
||||
elseif require'snippy'.can_expand_or_advance() then
|
||||
require'snippy'.expand_or_advance()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
|
||||
local select_previous = function(fallback)
|
||||
if cmp.visible() then
|
||||
if require'snippy'.can_expand_or_advance() then
|
||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||
else
|
||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Insert })
|
||||
end
|
||||
elseif require'snippy'.can_jump(-1) then
|
||||
require'snippy'.previous()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
|
@ -24,33 +48,10 @@ cmp.setup({
|
|||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if require'snippy'.can_expand_or_advance() then
|
||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||
else
|
||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert })
|
||||
end
|
||||
elseif require'snippy'.can_expand_or_advance() then
|
||||
require'snippy'.expand_or_advance()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if require'snippy'.can_expand_or_advance() then
|
||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||
else
|
||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Insert })
|
||||
end
|
||||
elseif require'snippy'.can_jump(-1) then
|
||||
require'snippy'.previous()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<Tab>"] = cmp.mapping(select_next, { "i", "s" }),
|
||||
["<C-J>"] = cmp.mapping(select_next, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(select_previous, { "i", "s" }),
|
||||
["<C-K>"] = cmp.mapping(select_previous, { "i", "s" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
|
|
|
@ -19,6 +19,7 @@ vim.keymap.set("n", "gn", ":n<cr>", { noremap = true, silent = true })
|
|||
vim.keymap.set("n", "<leader>d", ":TroubleToggle<cr>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "gi", ":ClangdSwitchSourceHeader<cr>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<leader>t", ":NvimTreeFindFileToggle<cr>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<leader>g", ":Neogit<cr>", { noremap = true, silent = true })
|
||||
vim.keymap.set("x", "<leader>a", "<C-A>", { noremap = true, silent = true })
|
||||
vim.keymap.set("x", "<leader>x", "<C-X>", { noremap = true, silent = true })
|
||||
vim.keymap.set("x", "<leader>ga", "g<C-A>", { noremap = true, silent = true })
|
||||
|
|
|
@ -15,17 +15,18 @@ vim.opt.rtp:prepend(lazypath)
|
|||
require('lazy').setup({
|
||||
'ConradIrwin/vim-bracketed-paste',
|
||||
'airblade/vim-rooter',
|
||||
'cappyzawa/trim.nvim',
|
||||
'ggandor/leap.nvim',
|
||||
{'cappyzawa/trim.nvim', config = function () require("trim").setup({ ft_blocklist= {"markdown", "vimwiki"}, patterns = { [[%s/\s\+$//e]], [[%s/\($\n\s*\)\+\%$//]], [[%s/\%^\n\+//]], }, }) end},
|
||||
{'ggandor/leap.nvim', config = function () require('leap').set_default_keymaps() end},
|
||||
'mhartington/formatter.nvim',
|
||||
'intrntbrn/awesomewm-vim-tmux-navigator',
|
||||
'numToStr/Comment.nvim',
|
||||
{'numToStr/Comment.nvim', config = function () require('Comment').setup() end},
|
||||
'debugloop/telescope-undo.nvim',
|
||||
{'vimwiki/vimwiki'},
|
||||
'windwp/nvim-autopairs',
|
||||
{'windwp/nvim-autopairs', setup = function () require('nvim-autopairs').setup({check_ts = true}) require('nvim-autopairs').add_rules(require "nvim-autopairs.rules.endwise-lua")
|
||||
end},
|
||||
{'lervag/vimtex', ft='latex'},
|
||||
{'williamboman/mason-lspconfig.nvim', dependencies = {'williamboman/mason.nvim', 'neovim/nvim-lspconfig'}},
|
||||
{"folke/trouble.nvim", dependencies = {"nvim-tree/nvim-web-devicons"}},
|
||||
{"folke/trouble.nvim", dependencies = {"nvim-tree/nvim-web-devicons"}, config = function () require('trouble').setup() end},
|
||||
{"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"},
|
||||
{"NeogitOrg/neogit", dependencies = {"nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "sindrets/diffview.nvim"}, config = true},
|
||||
{'hrsh7th/nvim-cmp', dependencies = {'hrsh7th/cmp-buffer', 'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', 'dcampos/nvim-snippy', 'honza/vim-snippets','dcampos/cmp-snippy' }},
|
||||
|
@ -33,5 +34,5 @@ require('lazy').setup({
|
|||
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' },
|
||||
{'nvim-telescope/telescope.nvim', dependencies = {'nvim-lua/plenary.nvim'}},
|
||||
{'nvim-tree/nvim-tree.lua', dependencies = {'nvim-tree/nvim-web-devicons'}, tag = 'nightly'},
|
||||
{dir = '~/.config/nvim/colorschemes/material', dependencies= {"rktjmp/lush.nvim"}},
|
||||
{dir = '~/.config/nvim/colorschemes/material', dependencies= {"rktjmp/lush.nvim"}, config = function () vim.cmd("colorscheme material") end},
|
||||
})
|
||||
|
|
|
@ -37,10 +37,6 @@ vim.wo.relativenumber = true
|
|||
vim.g.rooter_patterns = {".git", "Makefile", "CMakeLists.txt", "build/"}
|
||||
vim.g.rooter_silent_chdir = 1
|
||||
|
||||
-- Tab for completion
|
||||
vim.g.SuperTabContextDefaultCompletionType = "<c-n>"
|
||||
vim.g.SuperTabDefaultCompletionType = "<c-n>"
|
||||
|
||||
-- VimWiki
|
||||
vim.g.vimwiki_list = {{path = '~/Workspace/D&D/Lumentis Campaign Setting/', syntax = 'markdown', ext = '.md'}}
|
||||
vim.g.vimwiki_key_mappings = { table_mappings = 0 }
|
||||
|
|
|
@ -44,8 +44,9 @@ require("telescope").setup{
|
|||
},
|
||||
extensions = {
|
||||
undo = {
|
||||
side_by_side = true,
|
||||
side_by_side = false,
|
||||
layout_strategy = "vertical",
|
||||
use_delta = true,
|
||||
layout_config = {
|
||||
preview_height = 0.5,
|
||||
},
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
local hastrim, trim = pcall(require, "trim")
|
||||
if not hastrim then
|
||||
return
|
||||
end
|
||||
|
||||
trim.setup({
|
||||
ft_blocklist= {"markdown", "vimwiki"},
|
||||
patterns = {
|
||||
[[%s/\s\+$//e]], -- remove unwanted spaces
|
||||
[[%s/\($\n\s*\)\+\%$//]], -- trim last line
|
||||
[[%s/\%^\n\+//]], -- trim first line
|
||||
},
|
||||
})
|
Loading…
Reference in New Issue