diff --git a/nvim/init.lua b/nvim/init.lua index 57cc4de..4b7ca75 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -13,7 +13,6 @@ opt.updatetime = 300 opt.timeoutlen = 200 vim.g.BASH_Ctrl_j = "off" vim.g.BASH_Ctrl_l = "off" -vim.g.python3_host_prog = "/usr/bin/python3.10" -- looks opt.termguicolors = true @@ -93,6 +92,7 @@ vim.api.nvim_command [[augroup MYAU]] vim.api.nvim_command [[autocmd!]] vim.api.nvim_command [[autocmd BufWritePost * %s/\s\+$//e]] 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 ]] vim.api .nvim_command [[autocmd TextYankPost * "lua vim.highlight.on_yank {on_visual = false}"]] @@ -214,6 +214,15 @@ require("packer").startup { "iberianpig/tig-explorer.vim", requires = {"rbgrouleff/bclose.vim"}, config = function() + vim.tig_explorer_keymap_edit_e = 'e' + vim.tig_explorer_keymap_edit = '' + vim.tig_explorer_keymap_tabedit = '' + vim.tig_explorer_keymap_split = '' + vim.tig_explorer_keymap_vsplit = '' + vim.tig_explorer_keymap_commit_edit = 'o' + vim.tig_explorer_keymap_commit_tabedit = 't' + vim.tig_explorer_keymap_commit_split = 's' + vim.tig_explorer_keymap_commit_vsplit = 'v' vim.g.tig_explorer_use_builtin_term = 0 local map = vim.api.nvim_set_keymap map("", "gg", ":TigOpenProjectRootDir", {}) @@ -408,17 +417,7 @@ require("packer").startup { end } - use { - "numtostr/FTerm.nvim", - config = function() - require("FTerm").setup {} - local map = vim.api.nvim_set_keymap - local opts = {noremap = true, silent = true} - map("n", "", [[lua require("FTerm").toggle()]], opts) - map("t", "", [[lua require("FTerm").toggle()]], - opts) - end - } + use {"prettier/vim-prettier"} use { "psf/black", @@ -552,15 +551,12 @@ require("packer").startup { requires = { {"hrsh7th/cmp-path", after = "nvim-cmp"}, {"hrsh7th/cmp-buffer", after = "nvim-cmp"}, - {"hrsh7th/cmp-calc", after = "nvim-cmp"} + {"hrsh7th/cmp-cmdline", after = "nvim-cmp"} }, config = function() local cmp = require("cmp") cmp.setup({ - sources = { - {name = "nvim_lsp"}, {name = "buffer"}, {name = "path"}, - {name = "nvim_lua"} - }, + sources = cmp.config.sources({{name = "nvim_lsp"}, {name = "buffer"}}), mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), @@ -571,6 +567,24 @@ require("packer").startup { mapping = cmp.mapping.preset.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 }