update and optimize nvim
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
require("ts_context_commentstring").setup({
|
require("ts_context_commentstring").setup({
|
||||||
enable_autocmd = false,
|
enable_autocmd = false,
|
||||||
})
|
})
|
||||||
require('Comment').setup({
|
require('mini.comment').setup({
|
||||||
ignore = '^$', -- Ignore empty lines
|
ignore = '^$', -- Ignore empty lines
|
||||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ local servers = {
|
|||||||
|
|
||||||
-- Default handlers for LSP
|
-- Default handlers for LSP
|
||||||
local default_handlers = {
|
local default_handlers = {
|
||||||
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }),
|
["textDocument/hover"] = vim.lsp.buf.hover({ border = "rounded" }),
|
||||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded", focus = false }),
|
["textDocument/signatureHelp"] = vim.lsp.buf.signature_help({ border = "rounded", focus = false }),
|
||||||
}
|
}
|
||||||
|
|
||||||
-- nvim-cmp supports additional completion capabilities
|
-- nvim-cmp supports additional completion capabilities
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require'nvim-treesitter.configs'.setup {
|
require 'nvim-treesitter'.setup {
|
||||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||||
ensure_installed = { "bash", "bibtex", "c", "cpp", "lua", "markdown", "python", "vim", "vimdoc" },
|
ensure_installed = { "bash", "bibtex", "c", "cpp", "lua", "markdown", "python", "vim", "vimdoc" },
|
||||||
|
|
||||||
@@ -46,7 +46,6 @@ function M.nvim_create_augroups(definitions)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local autoCommands = {
|
local autoCommands = {
|
||||||
-- other autocommands
|
-- other autocommands
|
||||||
open_folds = {
|
open_folds = {
|
||||||
|
|||||||
@@ -19,29 +19,35 @@ bootstrap_pckr()
|
|||||||
require('pckr').add {
|
require('pckr').add {
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
tag = '0.1.1',
|
version = '*',
|
||||||
-- or branch = '0.1.x',
|
requires = {
|
||||||
requires = { {'nvim-lua/plenary.nvim'} }
|
{ 'nvim-lua/plenary.nvim' },
|
||||||
};
|
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||||
"ellisonleao/gruvbox.nvim";
|
}
|
||||||
|
},
|
||||||
|
"ellisonleao/gruvbox.nvim",
|
||||||
{
|
{
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = function()
|
branch = "main",
|
||||||
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
|
build = ':TSUpdate'
|
||||||
ts_update()
|
},
|
||||||
end,
|
|
||||||
};
|
|
||||||
{
|
{
|
||||||
'ThePrimeagen/harpoon',
|
'ThePrimeagen/harpoon',
|
||||||
requires = { { 'nvim-lua/plenary.nvim' } }
|
requires = { { 'nvim-lua/plenary.nvim' } }
|
||||||
};
|
},
|
||||||
'mbbill/undotree';
|
'mbbill/undotree',
|
||||||
'tpope/vim-fugitive';
|
'tpope/vim-fugitive',
|
||||||
'airblade/vim-gitgutter';
|
'airblade/vim-gitgutter',
|
||||||
'lukas-reineke/indent-blankline.nvim';
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
'JoosepAlviste/nvim-ts-context-commentstring';
|
'JoosepAlviste/nvim-ts-context-commentstring',
|
||||||
'numToStr/Comment.nvim';
|
{
|
||||||
'lervag/vimtex';
|
'nvim-mini/mini.comment',
|
||||||
|
branch = "main",
|
||||||
|
config = function()
|
||||||
|
require('mini.comment').setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
'lervag/vimtex',
|
||||||
{
|
{
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
requires = {
|
requires = {
|
||||||
@@ -59,13 +65,16 @@ require('pckr').add{
|
|||||||
{ 'hrsh7th/cmp-path' },
|
{ 'hrsh7th/cmp-path' },
|
||||||
{ 'hrsh7th/cmp-cmdline' },
|
{ 'hrsh7th/cmp-cmdline' },
|
||||||
-- Snippets
|
-- Snippets
|
||||||
{'L3MON4D3/LuaSnip'},
|
{
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
run = "make install_jsregexp",
|
||||||
|
},
|
||||||
{ 'saadparwaiz1/cmp_luasnip' },
|
{ 'saadparwaiz1/cmp_luasnip' },
|
||||||
{ 'rafamadriz/friendly-snippets' },
|
{ 'rafamadriz/friendly-snippets' },
|
||||||
{ 'onsails/lspkind.nvim' },
|
{ 'onsails/lspkind.nvim' },
|
||||||
-- Utils
|
-- Utils
|
||||||
{ 'j-hui/fidget.nvim' },
|
{ 'j-hui/fidget.nvim' },
|
||||||
{ 'folke/neodev.nvim' }
|
{ 'folke/neodev.nvim' }
|
||||||
};
|
},
|
||||||
};
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,37 +90,37 @@ end
|
|||||||
|
|
||||||
-- Goto next diagnostic of any severity
|
-- Goto next diagnostic of any severity
|
||||||
nnoremap("]d", function()
|
nnoremap("]d", function()
|
||||||
vim.diagnostic.goto_next({})
|
vim.diagnostic.jump({ count = 1, float = true })
|
||||||
vim.api.nvim_feedkeys("zz", "n", false)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Goto prev diagnostic of any severity
|
-- Goto prev diagnostic of any severity
|
||||||
nnoremap("[d", function()
|
nnoremap("[d", function()
|
||||||
vim.diagnostic.goto_prev({})
|
vim.diagnostic.jump({ count = -1, float = true })
|
||||||
vim.api.nvim_feedkeys("zz", "n", false)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Goto next error diagnostic
|
-- Goto next error diagnostic
|
||||||
nnoremap("]e", function()
|
nnoremap("]e", function()
|
||||||
vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR })
|
vim.diagnostic.jump({ severity = vim.diagnostic.severity.ERROR, count = 1, float = true })
|
||||||
vim.api.nvim_feedkeys("zz", "n", false)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Goto previous error diagnostic
|
-- Goto previous error diagnostic
|
||||||
nnoremap("[e", function()
|
nnoremap("[e", function()
|
||||||
vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR })
|
vim.diagnostic.jump({ severity = vim.diagnostic.severity.ERROR, count = -1, float = true })
|
||||||
vim.api.nvim_feedkeys("zz", "n", false)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Goto next warning diagnostic
|
-- Goto next warning diagnostic
|
||||||
nnoremap("]w", function()
|
nnoremap("]w", function()
|
||||||
vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.WARN })
|
vim.diagnostic.jump({ severity = vim.diagnostic.severity.WARN, count = 1, float = true })
|
||||||
vim.api.nvim_feedkeys("zz", "n", false)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Goto previous warning diagnostic
|
-- Goto previous warning diagnostic
|
||||||
nnoremap("[w", function()
|
nnoremap("[w", function()
|
||||||
vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.WARN })
|
vim.diagnostic.jump({ severity = vim.diagnostic.severity.WARN, count = -1, float = true })
|
||||||
vim.api.nvim_feedkeys("zz", "n", false)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
autocmd VimLeave *.tex !texclear %
|
autocmd VimLeave *.tex !texclear %
|
||||||
|
|
||||||
" Ensure files are read as what I want:
|
" Ensure files are read as what I want:
|
||||||
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
|
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.mdx': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
|
||||||
map <leader>v :VimwikiIndex<CR>
|
map <leader>v :VimwikiIndex<CR>
|
||||||
let g:vimwiki_list = [{'path': '~/.local/share/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}]
|
let g:vimwiki_list = [{'path': '~/.local/share/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}]
|
||||||
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
|
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
|
||||||
@@ -37,6 +37,11 @@
|
|||||||
autocmd BufWritePost ~/.config/i3/config !i3 restart
|
autocmd BufWritePost ~/.config/i3/config !i3 restart
|
||||||
autocmd BufWritePost ~/.config/i3blocks/config !i3 restart
|
autocmd BufWritePost ~/.config/i3blocks/config !i3 restart
|
||||||
|
|
||||||
|
" Remove checkhealth warning for optionnal providers
|
||||||
|
let g:loaded_node_provider = 0
|
||||||
|
let g:loaded_perl_provider = 0
|
||||||
|
let g:loaded_ruby_provider = 0
|
||||||
|
|
||||||
" Function for toggling the bottom statusbar:
|
" Function for toggling the bottom statusbar:
|
||||||
let s:hidden_all = 0
|
let s:hidden_all = 0
|
||||||
function! ToggleHiddenAll()
|
function! ToggleHiddenAll()
|
||||||
|
|||||||
Reference in New Issue
Block a user