|
|
|
@ -19,24 +19,54 @@ Plug 'vifm/vifm.vim'
|
|
|
|
|
|
|
|
|
|
|
|
" Git nuff said
|
|
|
|
" Git nuff said
|
|
|
|
Plug 'tpope/vim-fugitive'
|
|
|
|
Plug 'tpope/vim-fugitive'
|
|
|
|
|
|
|
|
Plug 'airblade/vim-gitgutter'
|
|
|
|
|
|
|
|
|
|
|
|
" Latex
|
|
|
|
" Latex
|
|
|
|
Plug 'lervag/vimtex'
|
|
|
|
Plug 'lervag/vimtex'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Rust
|
|
|
|
|
|
|
|
Plug 'rust-lang/rust.vim'
|
|
|
|
|
|
|
|
let g:rustfmt_autosave = 1
|
|
|
|
|
|
|
|
if has("nvim")
|
|
|
|
|
|
|
|
Plug 'simrat39/rust-tools.nvim' " Adds extra functionality over rust analyzer
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Markdown
|
|
|
|
|
|
|
|
Plug 'preservim/vim-markdown'
|
|
|
|
|
|
|
|
|
|
|
|
" Table mode
|
|
|
|
" Table mode
|
|
|
|
Plug 'dhruvasagar/vim-table-mode'
|
|
|
|
Plug 'dhruvasagar/vim-table-mode'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Color schemes
|
|
|
|
|
|
|
|
Plug 'zoomiti/firewatch'
|
|
|
|
|
|
|
|
Plug 'sonph/onehalf', { 'rtp': 'vim' }
|
|
|
|
|
|
|
|
Plug 'sjl/badwolf'
|
|
|
|
|
|
|
|
Plug 'lifepillar/vim-colortemplate'
|
|
|
|
|
|
|
|
Plug 'cocopon/inspecthi.vim'
|
|
|
|
|
|
|
|
|
|
|
|
if has("nvim")
|
|
|
|
if has("nvim")
|
|
|
|
" LSP
|
|
|
|
" LSP
|
|
|
|
Plug 'neovim/nvim-lspconfig'
|
|
|
|
Plug 'neovim/nvim-lspconfig'
|
|
|
|
Plug 'hrsh7th/cmp-nvim-lsp'
|
|
|
|
Plug 'hrsh7th/cmp-nvim-lsp'
|
|
|
|
Plug 'hrsh7th/nvim-cmp' " For LSP completion
|
|
|
|
Plug 'hrsh7th/nvim-cmp' " For LSP completion
|
|
|
|
|
|
|
|
|
|
|
|
"Lean requires nvim
|
|
|
|
" Debugging
|
|
|
|
|
|
|
|
Plug 'mfussenegger/nvim-dap'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Lean requires nvim
|
|
|
|
Plug 'Julian/lean.nvim'
|
|
|
|
Plug 'Julian/lean.nvim'
|
|
|
|
Plug 'nvim-lua/plenary.nvim'
|
|
|
|
Plug 'nvim-lua/plenary.nvim'
|
|
|
|
Plug 'andrewradev/switch.vim' " For Lean switch support
|
|
|
|
Plug 'andrewradev/switch.vim' " For Lean switch support
|
|
|
|
end
|
|
|
|
Plug 'norcalli/nvim-colorizer.lua' " For colorizing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Tree sitter
|
|
|
|
|
|
|
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
|
|
|
|
|
|
|
Plug 'lewis6991/spellsitter.nvim'
|
|
|
|
|
|
|
|
Plug 'nvim-treesitter/playground'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Copilot
|
|
|
|
|
|
|
|
Plug 'github/copilot.vim'
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
call plug#end()
|
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
|
|
|
|
@ -150,110 +180,187 @@ if filereadable("/etc/vim/vimrc.local")
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
" LSP Setup
|
|
|
|
" LSP Setup
|
|
|
|
|
|
|
|
|
|
|
|
if has("nvim")
|
|
|
|
if has("nvim")
|
|
|
|
lua << EOF
|
|
|
|
lua << EOF
|
|
|
|
|
|
|
|
-- Setup treesitter
|
|
|
|
|
|
|
|
require'nvim-treesitter.configs'.setup {
|
|
|
|
|
|
|
|
-- A list of parser names, or "all"
|
|
|
|
|
|
|
|
ensure_installed = { "c", "lua", "rust", "vim" },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
|
|
|
|
|
|
|
sync_install = false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Automatically install missing parsers when entering buffer
|
|
|
|
|
|
|
|
auto_install = true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- List of parsers to ignore installing (for "all")
|
|
|
|
|
|
|
|
ignore_install = { "javascript" },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
highlight = {
|
|
|
|
|
|
|
|
-- `false` will disable the whole extension
|
|
|
|
|
|
|
|
enable = true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
|
|
|
|
|
|
|
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
|
|
|
|
|
|
|
-- the name of the parser)
|
|
|
|
|
|
|
|
-- list of language that will be disabled
|
|
|
|
|
|
|
|
disable = { 'latex', 'markdown' },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
|
|
|
|
|
|
|
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
|
|
|
|
|
|
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
|
|
|
|
|
|
|
-- Instead of true it can also be a list of languages
|
|
|
|
|
|
|
|
additional_vim_regex_highlighting = false,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
incremental_selection = {
|
|
|
|
|
|
|
|
enable = true,
|
|
|
|
|
|
|
|
keymaps = {
|
|
|
|
|
|
|
|
init_selction = "gnn",
|
|
|
|
|
|
|
|
node_incremental = "grn",
|
|
|
|
|
|
|
|
scope_incremental = "grc",
|
|
|
|
|
|
|
|
node_decremental = "grm",
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
indent = {
|
|
|
|
|
|
|
|
enable = true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
playground = {
|
|
|
|
|
|
|
|
enable = true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
require('spellsitter').setup()
|
|
|
|
|
|
|
|
require'colorizer'.setup()
|
|
|
|
|
|
|
|
|
|
|
|
-- Setup nvim-cmp.
|
|
|
|
-- Setup nvim-cmp.
|
|
|
|
local cmp = require'cmp'
|
|
|
|
local cmp = require'cmp'
|
|
|
|
|
|
|
|
|
|
|
|
cmp.setup({
|
|
|
|
cmp.setup({
|
|
|
|
snippet = {
|
|
|
|
snippet = {
|
|
|
|
expand = function(args)
|
|
|
|
expand = function(args)
|
|
|
|
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
|
|
|
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
|
|
|
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
|
|
|
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
|
|
|
vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
|
|
|
vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
|
|
|
-- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
|
|
|
|
-- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mapping = {
|
|
|
|
mapping = {
|
|
|
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
|
|
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
|
|
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
|
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
|
|
['<C-Space>'] = cmp.mapping.complete(),
|
|
|
|
['<C-Space>'] = cmp.mapping.complete(),
|
|
|
|
['<C-e>'] = cmp.mapping.close(),
|
|
|
|
['<C-e>'] = cmp.mapping.close(),
|
|
|
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
|
|
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
|
|
|
},
|
|
|
|
['<tab>'] = cmp.mapping(function(fallback)
|
|
|
|
sources = cmp.config.sources({
|
|
|
|
if cmp.visible() then
|
|
|
|
|
|
|
|
cmp.select_next_item()
|
|
|
|
|
|
|
|
-- elseif luasnip.expand_or_jumpable() then
|
|
|
|
|
|
|
|
-- luasnip.expand_or_jump()
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
fallback()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end, { 'i', 's' }),
|
|
|
|
|
|
|
|
['<S-tab>'] = cmp.mapping(function(fallback)
|
|
|
|
|
|
|
|
if cmp.visible() then
|
|
|
|
|
|
|
|
cmp.select_prev_item()
|
|
|
|
|
|
|
|
-- elseif luasnip.jumpable(-1) then
|
|
|
|
|
|
|
|
-- luasnip.jump(-1)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
fallback()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end, { 'i', 's' }),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
sources = cmp.config.sources({
|
|
|
|
{ name = 'nvim_lsp' },
|
|
|
|
{ name = 'nvim_lsp' },
|
|
|
|
-- { name = 'vsnip' }, -- For vsnip users.
|
|
|
|
-- { name = 'vsnip' }, -- For vsnip users.
|
|
|
|
-- { name = 'luasnip' }, -- For luasnip users.
|
|
|
|
-- { name = 'luasnip' }, -- For luasnip users.
|
|
|
|
{ name = 'ultisnips' }, -- For ultisnips users.
|
|
|
|
{ name = 'ultisnips' }, -- For ultisnips users.
|
|
|
|
-- { name = 'snippy' }, -- For snippy users.
|
|
|
|
-- { name = 'snippy' }, -- For snippy users.
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
{ name = 'buffer' },
|
|
|
|
{ name = 'buffer' },
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Setup lspconfig.
|
|
|
|
-- Setup lspconfig.
|
|
|
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
|
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
|
|
require('lspconfig')['texlab'].setup { capabilities = capabilities }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function on_attach(client, bufnr)
|
|
|
|
local function on_attach(client, bufnr)
|
|
|
|
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
|
|
|
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
|
|
|
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
|
|
|
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
|
|
|
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', {noremap = true})
|
|
|
|
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', {noremap = true})
|
|
|
|
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true})
|
|
|
|
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true})
|
|
|
|
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
|
|
buf_set_keymap('n', '<RightMouse>', '<Cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true})
|
|
|
|
|
|
|
|
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('lspconfig')['pyright'].setup({ capabilities = capabilities, on_attach = on_attach })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('lspconfig')['texlab'].setup({ capabilities = capabilities, on_attach = on_attach })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('rust-tools').setup({ server = {capabilities = capabilities, on_attach = on_attach } })
|
|
|
|
|
|
|
|
|
|
|
|
require('lean').setup{
|
|
|
|
require('lean').setup{
|
|
|
|
-- Enable the Lean language server(s)?
|
|
|
|
-- Enable the Lean language server(s)?
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- false to disable, otherwise should be a table of options to pass to
|
|
|
|
-- false to disable, otherwise should be a table of options to pass to
|
|
|
|
-- `leanls` and/or `lean3ls`.
|
|
|
|
-- `leanls` and/or `lean3ls`.
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- See https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#leanls for details.
|
|
|
|
-- See https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#leanls for details.
|
|
|
|
|
|
|
|
|
|
|
|
-- Lean 4
|
|
|
|
-- Lean 4
|
|
|
|
lsp = { on_attach = on_attach },
|
|
|
|
lsp = { on_attach = on_attach },
|
|
|
|
|
|
|
|
|
|
|
|
-- Lean 3
|
|
|
|
-- Lean 3
|
|
|
|
lsp3 = { on_attach = on_attach },
|
|
|
|
lsp3 = { on_attach = on_attach },
|
|
|
|
|
|
|
|
|
|
|
|
-- What filetype should be associated with standalone Lean files?
|
|
|
|
-- What filetype should be associated with standalone Lean files?
|
|
|
|
-- Can be set to "lean3" if you prefer that default.
|
|
|
|
-- Can be set to "lean3" if you prefer that default.
|
|
|
|
-- Having a leanpkg.toml or lean-toolchain file should always mean
|
|
|
|
-- Having a leanpkg.toml or lean-toolchain file should always mean
|
|
|
|
-- autodetection works correctly.
|
|
|
|
-- autodetection works correctly.
|
|
|
|
ft = { default = "lean3" },
|
|
|
|
ft = { default = "lean3" },
|
|
|
|
|
|
|
|
|
|
|
|
-- Abbreviation support
|
|
|
|
-- Abbreviation support
|
|
|
|
abbreviations = {
|
|
|
|
abbreviations = {
|
|
|
|
-- Set one of the following to true to enable abbreviations
|
|
|
|
-- Set one of the following to true to enable abbreviations
|
|
|
|
builtin = true, -- built-in expander
|
|
|
|
builtin = true, -- built-in expander
|
|
|
|
compe = false, -- nvim-compe source
|
|
|
|
compe = false, -- nvim-compe source
|
|
|
|
snippets = false, -- snippets.nvim source
|
|
|
|
snippets = false, -- snippets.nvim source
|
|
|
|
-- additional abbreviations:
|
|
|
|
-- additional abbreviations:
|
|
|
|
extra = {
|
|
|
|
extra = {
|
|
|
|
-- Add a \wknight abbreviation to insert ♘
|
|
|
|
-- Add a \wknight abbreviation to insert ♘
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- Note that the backslash is implied, and that you of
|
|
|
|
-- Note that the backslash is implied, and that you of
|
|
|
|
-- course may also use a snippet engine directly to do
|
|
|
|
-- course may also use a snippet engine directly to do
|
|
|
|
-- this if so desired.
|
|
|
|
-- this if so desired.
|
|
|
|
wknight = '♘',
|
|
|
|
wknight = '♘',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
-- Change if you don't like the backslash
|
|
|
|
-- Change if you don't like the backslash
|
|
|
|
-- (comma is a popular choice on French keyboards)
|
|
|
|
-- (comma is a popular choice on French keyboards)
|
|
|
|
leader = '\\',
|
|
|
|
leader = '\\',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
-- Enable suggested mappings?
|
|
|
|
-- Enable suggested mappings?
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- false by default, true to enable
|
|
|
|
-- false by default, true to enable
|
|
|
|
mappings = true,
|
|
|
|
mappings = true,
|
|
|
|
|
|
|
|
|
|
|
|
-- Infoview support
|
|
|
|
-- Infoview support
|
|
|
|
infoview = {
|
|
|
|
infoview = {
|
|
|
|
-- Automatically open an infoview on entering a Lean buffer?
|
|
|
|
-- Automatically open an infoview on entering a Lean buffer?
|
|
|
|
autoopen = true,
|
|
|
|
autoopen = true,
|
|
|
|
-- Set the infoview windows' widths
|
|
|
|
-- Set the infoview windows' widths
|
|
|
|
width = 30,
|
|
|
|
width = 30,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
-- Progress bar support
|
|
|
|
-- Progress bar support
|
|
|
|
progress_bars = {
|
|
|
|
progress_bars = {
|
|
|
|
-- Enable the progress bars?
|
|
|
|
-- Enable the progress bars?
|
|
|
|
enable = true,
|
|
|
|
enable = true,
|
|
|
|
-- Use a different priority for the signs
|
|
|
|
-- Use a different priority for the signs
|
|
|
|
priority = 10,
|
|
|
|
priority = 10,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|