begin nvim config cleanup
This commit is contained in:
parent
d2d85c8cff
commit
4ecc5566b4
37 changed files with 326 additions and 476 deletions
7
.config/nvim/lua/plugins/autopairs.lua
Normal file
7
.config/nvim/lua/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
opts = {
|
||||
disable_filetype = { "TelescopePrompt", "vim" },
|
||||
},
|
||||
}
|
||||
59
.config/nvim/lua/plugins/cmp.lua
Normal file
59
.config/nvim/lua/plugins/cmp.lua
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'onsails/lspkind.nvim'
|
||||
},
|
||||
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local lspkind = require('lspkind')
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert'
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-k>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-j>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete {},
|
||||
['<CR>'] = cmp.mapping.confirm { select = true },
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
|
||||
--- @diagnostic disable-next-line: missing-fields
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol_text',
|
||||
show_labelDetails = true,
|
||||
menu = ({
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
12
.config/nvim/lua/plugins/comment.lua
Normal file
12
.config/nvim/lua/plugins/comment.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {},
|
||||
config = function()
|
||||
vim.keymap.set({ 'n', 'i' }, '<C-_>', require('Comment.api').toggle.linewise.current)
|
||||
vim.keymap.set('v', '<C-_>', function()
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<ESC>', true, false, true), 'nx', false)
|
||||
require('Comment.api').toggle.linewise(vim.fn.visualmode())
|
||||
end
|
||||
)
|
||||
end
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
main = 'ibl',
|
||||
opts = {},
|
||||
}
|
||||
|
|
@ -1,20 +1,24 @@
|
|||
return {
|
||||
'Civitasv/cmake-tools.nvim',
|
||||
'averms/black-nvim',
|
||||
'numToStr/Navigator.nvim',
|
||||
'nvim-lualine/lualine.nvim',
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'rcarriga/nvim-notify',
|
||||
'tmux-plugins/vim-tmux',
|
||||
'tpope/vim-fugitive',
|
||||
'tpope/vim-rhubarb',
|
||||
'tpope/vim-sleuth',
|
||||
'tpope/vim-surround',
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
{ 'akinsho/bufferline.nvim', config = {} },
|
||||
{ 'ethanholz/nvim-lastplace', config = {} },
|
||||
{ 'numToStr/Comment.nvim', opts = {} },
|
||||
{ 'wakatime/vim-wakatime', event = 'VeryLazy' },
|
||||
{ "folke/trouble.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, opts = { }, }
|
||||
'rcarriga/nvim-notify',
|
||||
{ 'kylechui/nvim-surround', version = '*', event = 'VeryLazy', opts = {} },
|
||||
{ 'akinsho/bufferline.nvim', config = {} },
|
||||
{ 'ethanholz/nvim-lastplace', config = {} },
|
||||
{ 'norcalli/nvim-colorizer.lua', opts = {}, config = function ()
|
||||
require('colorizer').setup()
|
||||
end },
|
||||
{ 'nvim-treesitter/nvim-treesitter-context', dependencies = { 'nvim-treesitter/nvim-treesitter' }},
|
||||
{ 'wakatime/vim-wakatime', event = 'VeryLazy' },
|
||||
|
||||
{ 'lukas-reineke/indent-blankline.nvim',
|
||||
main = 'ibl',
|
||||
opts = {},
|
||||
dependencies = { 'olimorris/onedarkpro.nvim' }
|
||||
},
|
||||
|
||||
{ 'neovim/nvim-lspconfig', dependencies = {
|
||||
'folke/neodev.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'williamboman/mason.nvim',
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
}},
|
||||
}
|
||||
|
|
|
|||
14
.config/nvim/lua/plugins/navigator.lua
Normal file
14
.config/nvim/lua/plugins/navigator.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
'numToStr/Navigator.nvim',
|
||||
config = function()
|
||||
require('Navigator').setup({
|
||||
disable_on_zoom = true
|
||||
})
|
||||
local map = vim.keymap.set
|
||||
|
||||
map('n', '<A-h>', function() require("Navigator").left() end)
|
||||
map('n', '<A-j>', function() require("Navigator").down() end)
|
||||
map('n', '<A-k>', function() require("Navigator").up() end)
|
||||
map('n', '<A-l>', function() require("Navigator").right() end)
|
||||
end
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
opts = {}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
dependencies = {
|
||||
-- Snippet Engine & its associated nvim-cmp source
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
|
||||
-- Adds LSP completion capabilities
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
|
||||
-- Adds a number of user-friendly snippets
|
||||
'rafamadriz/friendly-snippets',
|
||||
},
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
|
||||
'folke/neodev.nvim',
|
||||
},
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
return {
|
||||
-- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
return {
|
||||
'navarasu/onedark.nvim',
|
||||
config = function()
|
||||
vim.cmd.colorscheme 'onedark'
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,8 +1,41 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make', },
|
||||
},
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||
},
|
||||
|
||||
config = function()
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-u>'] = false,
|
||||
['<C-d>'] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
|
||||
|
||||
vim.keymap.set('n', '<leader>/', function()
|
||||
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_ivy {
|
||||
winblend = 10,
|
||||
previewer = true,
|
||||
})
|
||||
end)
|
||||
|
||||
vim.keymap.set('n', '<leader>?', require('telescope.builtin').live_grep)
|
||||
vim.keymap.set('n', '<leader>of', require('telescope.builtin').oldfiles)
|
||||
vim.keymap.set('n', '<leader>af', require('telescope.builtin').git_files)
|
||||
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files)
|
||||
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags)
|
||||
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string)
|
||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics)
|
||||
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume)
|
||||
vim.keymap.set('n', '<leader>sm', require('telescope.builtin').treesitter)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
42
.config/nvim/lua/plugins/theme.lua
Normal file
42
.config/nvim/lua/plugins/theme.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
return {
|
||||
'navarasu/onedark.nvim',
|
||||
config = function()
|
||||
require('onedark').setup {
|
||||
style = 'darker',
|
||||
transparent = false,
|
||||
term_colors = false,
|
||||
ending_tildes = false,
|
||||
cmp_itemkind_reverse = false,
|
||||
|
||||
code_style = {
|
||||
comments = 'italic',
|
||||
keywords = 'none',
|
||||
functions = 'none',
|
||||
strings = 'none',
|
||||
variables = 'none'
|
||||
},
|
||||
|
||||
lualine = {
|
||||
transparent = true,
|
||||
},
|
||||
|
||||
colors = {
|
||||
bg0 = "#101010",
|
||||
bg1 = "#1a1a1a",
|
||||
bg2 = "#151515",
|
||||
bg3 = "#242424",
|
||||
bg_d = "#101010",
|
||||
fg = "#c6c6c6",
|
||||
},
|
||||
highlights = {},
|
||||
|
||||
diagnostics = {
|
||||
darker = true,
|
||||
undercurl = true,
|
||||
background = true,
|
||||
},
|
||||
}
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme 'onedark'
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
"numToStr/Navigator.nvim",
|
||||
}
|
||||
26
.config/nvim/lua/plugins/tree.lua
Normal file
26
.config/nvim/lua/plugins/tree.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
require("nvim-tree").setup({
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = false,
|
||||
ignore_list = { "help" },
|
||||
},
|
||||
filters = {
|
||||
custom = { '.git' },
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set('n', 'Ā', ':NvimTreeToggle<CR>', { silent = true })
|
||||
end
|
||||
}
|
||||
14
.config/nvim/lua/plugins/treesitter.lua
Normal file
14
.config/nvim/lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', },
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
vim.defer_fn(function()
|
||||
require('nvim-treesitter.configs').setup({
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end, 0)
|
||||
end
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue