vim updates

This commit is contained in:
Henrik Bakken
2023-03-06 02:01:42 +01:00
+31 -17
View File
@@ -13,7 +13,6 @@ opt.updatetime = 300
opt.timeoutlen = 200 opt.timeoutlen = 200
vim.g.BASH_Ctrl_j = "off" vim.g.BASH_Ctrl_j = "off"
vim.g.BASH_Ctrl_l = "off" vim.g.BASH_Ctrl_l = "off"
vim.g.python3_host_prog = "/usr/bin/python3.10"
-- looks -- looks
opt.termguicolors = true opt.termguicolors = true
@@ -93,6 +92,7 @@ vim.api.nvim_command [[augroup MYAU]]
vim.api.nvim_command [[autocmd!]] vim.api.nvim_command [[autocmd!]]
vim.api.nvim_command [[autocmd BufWritePost * %s/\s\+$//e]] vim.api.nvim_command [[autocmd BufWritePost * %s/\s\+$//e]]
vim.api.nvim_command [[autocmd BufWritePost *.py silent! execute ':Black']] vim.api.nvim_command [[autocmd BufWritePost *.py silent! execute ':Black']]
vim.api.nvim_command [[autocmd FileType *.py setlocal indentkeys-=<:>]]
vim.api.nvim_command [[autocmd BufReadPost quickfix nmap <buffer> <cr> <cr>]] vim.api.nvim_command [[autocmd BufReadPost quickfix nmap <buffer> <cr> <cr>]]
vim.api vim.api
.nvim_command [[autocmd TextYankPost * "lua vim.highlight.on_yank {on_visual = false}"]] .nvim_command [[autocmd TextYankPost * "lua vim.highlight.on_yank {on_visual = false}"]]
@@ -214,6 +214,15 @@ require("packer").startup {
"iberianpig/tig-explorer.vim", "iberianpig/tig-explorer.vim",
requires = {"rbgrouleff/bclose.vim"}, requires = {"rbgrouleff/bclose.vim"},
config = function() config = function()
vim.tig_explorer_keymap_edit_e = 'e'
vim.tig_explorer_keymap_edit = '<C-o>'
vim.tig_explorer_keymap_tabedit = '<C-t>'
vim.tig_explorer_keymap_split = '<C-s>'
vim.tig_explorer_keymap_vsplit = '<C-v>'
vim.tig_explorer_keymap_commit_edit = '<ESC>o'
vim.tig_explorer_keymap_commit_tabedit = '<ESC>t'
vim.tig_explorer_keymap_commit_split = '<ESC>s'
vim.tig_explorer_keymap_commit_vsplit = '<ESC>v'
vim.g.tig_explorer_use_builtin_term = 0 vim.g.tig_explorer_use_builtin_term = 0
local map = vim.api.nvim_set_keymap local map = vim.api.nvim_set_keymap
map("", "<leader>gg", ":TigOpenProjectRootDir<cr><cr>", {}) map("", "<leader>gg", ":TigOpenProjectRootDir<cr><cr>", {})
@@ -408,17 +417,7 @@ require("packer").startup {
end end
} }
use { use {"prettier/vim-prettier"}
"numtostr/FTerm.nvim",
config = function()
require("FTerm").setup {}
local map = vim.api.nvim_set_keymap
local opts = {noremap = true, silent = true}
map("n", "<F2>", [[<cmd>lua require("FTerm").toggle()<cr>]], opts)
map("t", "<F2>", [[<C-\><C-n><cmd>lua require("FTerm").toggle()<cr>]],
opts)
end
}
use { use {
"psf/black", "psf/black",
@@ -552,15 +551,12 @@ require("packer").startup {
requires = { requires = {
{"hrsh7th/cmp-path", after = "nvim-cmp"}, {"hrsh7th/cmp-path", after = "nvim-cmp"},
{"hrsh7th/cmp-buffer", after = "nvim-cmp"}, {"hrsh7th/cmp-buffer", after = "nvim-cmp"},
{"hrsh7th/cmp-calc", after = "nvim-cmp"} {"hrsh7th/cmp-cmdline", after = "nvim-cmp"}
}, },
config = function() config = function()
local cmp = require("cmp") local cmp = require("cmp")
cmp.setup({ cmp.setup({
sources = { sources = cmp.config.sources({{name = "nvim_lsp"}, {name = "buffer"}}),
{name = "nvim_lsp"}, {name = "buffer"}, {name = "path"},
{name = "nvim_lua"}
},
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
@@ -571,6 +567,24 @@ require("packer").startup {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}}) sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})
}) })
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{name = 'cmp_git'} -- You can specify the `cmp_git` source if you were installed it.
}, {{name = 'buffer'}})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({'/', '?'}, {
mapping = cmp.mapping.preset.cmdline(),
sources = {{name = 'buffer'}}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})
})
end end
} }