This commit is contained in:
Alex Yatskov 2022-10-22 09:53:29 -07:00
parent 5cd419ef6d
commit 01ba0543b9
5 changed files with 40 additions and 24 deletions

View File

@ -39,13 +39,13 @@ vim.keymap.set('n', 'j', 'gj')
vim.keymap.set('n', 'k', 'gk') vim.keymap.set('n', 'k', 'gk')
-- clipboard keymaps -- clipboard keymaps
vim.keymap.set({ 'n', 'v' }, '<leader>P', '"+P') vim.keymap.set({'n', 'v'}, '<leader>P', '"+P')
vim.keymap.set({ 'n', 'v' }, '<leader>Y', '"+y$') vim.keymap.set({'n', 'v'}, '<leader>Y', '"+y$')
vim.keymap.set({ 'n', 'v' }, '<leader>d', '"+d') vim.keymap.set({'n', 'v'}, '<leader>d', '"+d')
vim.keymap.set({ 'n', 'v' }, '<leader>d', '"+dd') vim.keymap.set({'n', 'v'}, '<leader>d', '"+dd')
vim.keymap.set({ 'n', 'v' }, '<leader>p', '"+p') vim.keymap.set({'n', 'v'}, '<leader>p', '"+p')
vim.keymap.set({ 'n', 'v' }, '<leader>y', '"+y') vim.keymap.set({'n', 'v'}, '<leader>y', '"+y')
vim.keymap.set({ 'n', 'v' }, '<leader>yy', '"+yy') vim.keymap.set({'n', 'v'}, '<leader>yy', '"+yy')
-- split keymaps -- split keymaps
vim.keymap.set('n', '<a-=>', '<c-w><c-=>') vim.keymap.set('n', '<a-=>', '<c-w><c-=>')

View File

@ -9,5 +9,5 @@ elseif vim.fn.has('win32') == 1 then
end end
if font then if font then
vim.cmd.Guifont({ args = { font }}) vim.cmd.Guifont({args = {font}})
end end

View File

@ -5,21 +5,21 @@ if nvim_lspconfig then
local cmp_nvim_lsp = require('cmp_nvim_lsp') local cmp_nvim_lsp = require('cmp_nvim_lsp')
if cmp_nvim_lsp then if cmp_nvim_lsp then
capabilities = cmp_nvim_lsp.update_capabilities(capabilities, { snippetSupport = false }) capabilities = cmp_nvim_lsp.update_capabilities(capabilities, {snippetSupport = false})
end end
nvim_lspconfig.clangd.setup({ capabilities = capabilities }) nvim_lspconfig.clangd.setup({capabilities = capabilities})
nvim_lspconfig.gopls.setup({ capabilities = capabilities }) nvim_lspconfig.gopls.setup({capabilities = capabilities})
nvim_lspconfig.jedi_language_server.setup({ capabilities = capabilities }) nvim_lspconfig.jedi_language_server.setup({capabilities = capabilities})
nvim_lspconfig.rust_analyzer.setup({ capabilities = capabilities }) nvim_lspconfig.rust_analyzer.setup({capabilities = capabilities})
nvim_lspconfig.tsserver.setup({ capabilities = capabilities }) nvim_lspconfig.tsserver.setup({capabilities = capabilities})
nvim_lspconfig.sumneko_lua.setup({ nvim_lspconfig.sumneko_lua.setup({
settings = { settings = {
Lua = { Lua = {
diagnostics = { globals = { 'vim' } }, diagnostics = {globals = { 'vim' }},
runtime = { version = 'LuaJIT' }, runtime = {version = 'LuaJIT'},
telemetry = { enable = false }, telemetry = {enable = false},
workspace = { library = vim.api.nvim_get_runtime_file('', true) }, workspace = {library = vim.api.nvim_get_runtime_file('', true)},
}, },
}, },
}) })
@ -28,7 +28,7 @@ if nvim_lspconfig then
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition) vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action) vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action)
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float) vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format({ async = true }) end) vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format({async = true}) end)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist) vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename) vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder) vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder)
@ -57,8 +57,8 @@ if nvim_cmp then
['<tab>'] = nvim_cmp.mapping.confirm({ select = true }), ['<tab>'] = nvim_cmp.mapping.confirm({ select = true }),
}, },
sources = { sources = {
{ name = 'nvim_lsp' }, {name = 'nvim_lsp'},
{ name = 'vsnip' }, {name = 'vsnip'},
}, },
snippet = { snippet = {
expand = function(args) vim.fn['vsnip#anonymous'](args.body) end, expand = function(args) vim.fn['vsnip#anonymous'](args.body) end,

View File

@ -4,6 +4,22 @@ vim.keymap.set('n', '<leader>fh', vim.cmd.History)
vim.keymap.set('n', '<leader>fb', vim.cmd.Buffers) vim.keymap.set('n', '<leader>fb', vim.cmd.Buffers)
vim.keymap.set('n', '<leader>fl', vim.cmd.Lines) vim.keymap.set('n', '<leader>fl', vim.cmd.Lines)
vim.g.fzf_colors = {
['bg'] = {'bg', 'Normal'},
['bg+'] = {'bg', 'CursorLine', 'CursorColumn'},
['border'] = {'fg', 'Ignore'},
['fg'] = {'fg', 'Normal'},
['fg+'] = {'fg', 'CursorLine', 'CursorColumn', 'Normal'},
['header'] = {'fg', 'Comment'},
['hl'] = {'fg', 'Comment'},
['hl+'] = {'fg', 'Statement'},
['info'] = {'fg', 'PreProc'},
['marker'] = {'fg', 'Keyword'},
['pointer'] = {'fg', 'Exception'},
['prompt'] = {'fg', 'Conditional'},
['spinner'] = {'fg', 'Label'},
}
-- hflip.nvim -- hflip.nvim
vim.keymap.set('n', 'gfs', vim.cmd.HFlip) vim.keymap.set('n', 'gfs', vim.cmd.HFlip)
@ -33,8 +49,8 @@ vim.g.go_null_module_warning = 0
vim.g.go_version_warning = 0 vim.g.go_version_warning = 0
-- vim-interestingwords -- vim-interestingwords
vim.g.interestingWordsGUIColors = { '#8ccbea', '#a4e57e', '#ffdb72', '#ff7272', '#ffb3ff', '#9999ff' } vim.g.interestingWordsGUIColors = {'#8ccbea', '#a4e57e', '#ffdb72', '#ff7272', '#ffb3ff', '#9999ff'}
vim.g.interestingWordsTermColors = { '154', '121', '211', '137', '214', '222' } vim.g.interestingWordsTermColors = {'154', '121', '211', '137', '214', '222'}
-- vim-polyglot -- vim-polyglot
vim.g.rustfmt_autosave = 1 vim.g.rustfmt_autosave = 1

View File

@ -2,5 +2,5 @@
vim.api.nvim_create_user_command( vim.api.nvim_create_user_command(
'UnAlign', 'UnAlign',
function(ctx) vim.cmd(ctx.line1 .. ',' .. ctx.line2 .. 's/\\(\\S\\+\\)\\s\\{2,\\}/\\1 /g') end, function(ctx) vim.cmd(ctx.line1 .. ',' .. ctx.line2 .. 's/\\(\\S\\+\\)\\s\\{2,\\}/\\1 /g') end,
{ range = '%' } {range = '%'}
) )