messinng around with vim config
This commit is contained in:
parent
59e2700336
commit
4cbe44f188
|
@ -337,6 +337,9 @@ in
|
||||||
-- autopairs
|
-- autopairs
|
||||||
require('nvim-autopairs').setup{}
|
require('nvim-autopairs').setup{}
|
||||||
|
|
||||||
|
-- marks
|
||||||
|
require('marks').setup{}
|
||||||
|
|
||||||
-- Setup nvim-cmp.
|
-- Setup nvim-cmp.
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
@ -355,21 +358,32 @@ in
|
||||||
end
|
end
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(entry, vim_item)
|
format = lspkind.cmp_format({
|
||||||
-- fancy icons and a name of kind
|
mode = 'symbol_text', -- show only symbol annotations
|
||||||
vim_item.kind = require("lspkind").presets.default[vim_item.kind] ..
|
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||||
" " .. vim_item.kind
|
|
||||||
-- set a name for each source
|
-- The function below will be called before any actual modifications from lspkind
|
||||||
vim_item.menu = ({
|
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
|
||||||
buffer = "[Buffer]",
|
before = function (entry, vim_item)
|
||||||
nvim_lsp = "[LSP]",
|
...
|
||||||
look = "[Look]",
|
|
||||||
path = "[Path]",
|
|
||||||
spell = "[Spell]",
|
|
||||||
calc = "[Calc]",
|
|
||||||
})[entry.source.name]
|
|
||||||
return vim_item
|
return vim_item
|
||||||
end
|
end
|
||||||
|
-- old format
|
||||||
|
-- format = function(entry, vim_item)
|
||||||
|
-- -- fancy icons and a name of kind
|
||||||
|
-- vim_item.kind = require("lspkind").presets.default[vim_item.kind] ..
|
||||||
|
-- " " .. vim_item.kind
|
||||||
|
-- -- set a name for each source
|
||||||
|
-- vim_item.menu = ({
|
||||||
|
-- buffer = "[Buffer]",
|
||||||
|
-- nvim_lsp = "[LSP]",
|
||||||
|
-- look = "[Look]",
|
||||||
|
-- path = "[Path]",
|
||||||
|
-- spell = "[Spell]",
|
||||||
|
-- calc = "[Calc]",
|
||||||
|
-- })[entry.source.name]
|
||||||
|
-- return vim_item
|
||||||
|
-- end
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
|
@ -403,15 +417,21 @@ in
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
},
|
},
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require'luasnip'.lsp_expand(args.body)
|
||||||
|
end
|
||||||
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{name = 'buffer'}, {name = 'nvim_lsp'},
|
{name = 'buffer'}, {name = 'nvim_lsp'},
|
||||||
{name = "look"}, {name = "path"},
|
{name = "look"}, {name = "path"},
|
||||||
{name = "calc"}, {name = "spell"},
|
{name = "calc"}, {name = "spell"},
|
||||||
{name = 'cmp-conjure'}
|
{name = 'cmp-conjure'}, {name = "luasnip"}
|
||||||
},
|
},
|
||||||
completion = {completeopt = 'menu,menuone,noinsert'}
|
completion = {completeopt = 'menu,menuone,noinsert'}
|
||||||
}
|
}
|
||||||
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = ' ' } }))
|
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = ' ' } }))
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
-- null-ls
|
-- null-ls
|
||||||
local null_ls = require "null-ls"
|
local null_ls = require "null-ls"
|
||||||
|
@ -511,6 +531,13 @@ in
|
||||||
-- if line.is_empty()
|
-- if line.is_empty()
|
||||||
-- line = os.time(<format>)
|
-- line = os.time(<format>)
|
||||||
-- return
|
-- return
|
||||||
|
|
||||||
|
-- auto session
|
||||||
|
require('auto-session').setup {
|
||||||
|
log_level = 'info',
|
||||||
|
auto_session_suppress_dirs = {'~/', '~/kitaab/vimwiki'}
|
||||||
|
}
|
||||||
|
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
@ -535,22 +562,16 @@ in
|
||||||
nodePackages.typescript-language-server
|
nodePackages.typescript-language-server
|
||||||
];
|
];
|
||||||
plugins = with pkgs.vimPlugins // customPlugins; [
|
plugins = with pkgs.vimPlugins // customPlugins; [
|
||||||
# you can use plugins from the pkgs
|
# ui
|
||||||
vim-which-key
|
vim-which-key
|
||||||
# general
|
|
||||||
vim-nix
|
|
||||||
fzf-vim
|
fzf-vim
|
||||||
vim-elixir
|
|
||||||
emmet-vim
|
|
||||||
nerdtree
|
nerdtree
|
||||||
neovim-ayu
|
neovim-ayu
|
||||||
goyo-vim
|
goyo-vim
|
||||||
csv-vim
|
|
||||||
rainbow_parentheses-vim
|
rainbow_parentheses-vim
|
||||||
vim-surround
|
vim-surround
|
||||||
vim-devicons
|
vim-devicons
|
||||||
nvim-web-devicons
|
nvim-web-devicons
|
||||||
direnv-vim
|
|
||||||
vim-peekaboo
|
vim-peekaboo
|
||||||
undotree
|
undotree
|
||||||
telescope-nvim
|
telescope-nvim
|
||||||
|
@ -562,6 +583,17 @@ in
|
||||||
dashboard-nvim
|
dashboard-nvim
|
||||||
FTerm-nvim
|
FTerm-nvim
|
||||||
barbar-nvim
|
barbar-nvim
|
||||||
|
auto-session
|
||||||
|
marks-nvim
|
||||||
|
lightspeed-nvim
|
||||||
|
|
||||||
|
# language
|
||||||
|
vim-nix
|
||||||
|
vim-elixir
|
||||||
|
python-syntax
|
||||||
|
emmet-vim
|
||||||
|
csv-vim
|
||||||
|
direnv-vim
|
||||||
|
|
||||||
# kitaab stuff
|
# kitaab stuff
|
||||||
vimwiki
|
vimwiki
|
||||||
|
@ -578,13 +610,14 @@ in
|
||||||
nvim-lsp-ts-utils
|
nvim-lsp-ts-utils
|
||||||
cmp-conjure
|
cmp-conjure
|
||||||
cmp-buffer
|
cmp-buffer
|
||||||
lspkind-nvim
|
|
||||||
cmp-path
|
cmp-path
|
||||||
cmp-spell
|
cmp-spell
|
||||||
nvim-autopairs
|
nvim-autopairs
|
||||||
cmp_luasnip
|
cmp_luasnip
|
||||||
luasnip
|
luasnip
|
||||||
lsp-format
|
lsp-format
|
||||||
|
friendly-snippets
|
||||||
|
lspkind-nvim
|
||||||
|
|
||||||
# git stuff
|
# git stuff
|
||||||
vim-fugitive
|
vim-fugitive
|
||||||
|
|
Loading…
Reference in a new issue