diff --git a/coc-settings.json b/coc-settings.json index e69de29..ed2998c 100644 --- a/coc-settings.json +++ b/coc-settings.json @@ -0,0 +1,3 @@ +{ + "suggest.enablePreselect": false +} diff --git a/lua/keys.lua b/lua/keys.lua index 94c4074..1594c60 100644 --- a/lua/keys.lua +++ b/lua/keys.lua @@ -10,13 +10,20 @@ vim.g.mapleader = ' ' nnoremap("pv", "Ex") nnoremap("pk", "PackerSync") nnoremap("", "w") -nnoremap("w", "bw") +nnoremap("w", ":Bdelete") +nnoremap("h", "h") +nnoremap("l", "l") +nnoremap("j", "j") +nnoremap("k", "k") -- xnoremap("p", "\"_dP") +nnoremap("v", ":vspl") +nnoremap("c", ":spl") -nnoremap("k", ":e ~/.config/nvim/lua/keys.lua") +nnoremap("m", ":e ~/.config/nvim/lua/keys.lua") nnoremap("o", ":e ~/.config/nvim/lua/opts.lua") nnoremap("i", ":e ~/.config/nvim/init.lua") nnoremap("p", ":e ~/.config/nvim/lua/plug.lua") +nnoremap("gf", ":e ") -- FloaTerm configuration nmap("t", ":FloatermNew --name=myfloat --height=0.85 --width=0.75 --autoclose=2 bash ") @@ -33,7 +40,10 @@ nnoremap("", ":bn") nnoremap("", ":noh") -- run rust tests -nmap("r", ":FloatermNew --name=myfloat --height=0.85 --width=0.75 --autoclose=2 bash cargo test") +-- nmap("r", ":FloatermNew --name=myfloat --height=0.85 --width=0.75 --autoclose=2 bash cargo test") + +-- run python tests +nmap("r", ":FloatermNew --name=myfloat --height=0.85 --width=0.75 --autoclose=2 bash pytest") -- Telescope nnoremap("f", "lua require('telescope.builtin').find_files()") @@ -43,7 +53,7 @@ nnoremap("b", "lua require('telescope.builtin').buffers()") -- source current file nnoremap("s", "source") -nmap("l", ":call CocAction('diagnosticNext')") +nmap("n", ":call CocAction('diagnosticNext')") nmap("gd", ":call CocAction('jumpDefinition')") -- In insert or command mode, move normally by using Ctrl diff --git a/lua/opts.lua b/lua/opts.lua index 5f7e2a4..0845277 100644 --- a/lua/opts.lua +++ b/lua/opts.lua @@ -11,6 +11,8 @@ vim.opt.expandtab = true vim.opt.hlsearch = false vim.opt.incsearch = true vim.opt.wrap = true +vim.opt.mouse = "" + vim.opt.smartindent = true @@ -43,9 +45,52 @@ let g:vimspector_bottombar_height = 15 let g:vimspector_terminal_maxwidth = 70 ]]) -require('nvim-treesitter.configs').setup { - indent = { +require("nvim-treesitter.configs").setup { + ensure_installed = { + "bash", + "c", + "css", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "regex", + "rust", + "scss", + "sql", + "toml", + "tsx", + "typescript", + "vim", + "yaml", + }, + filetypes = { + "html", + "javascript", + "svelte", + "typescript", + "xml", + }, + yati = { enable = true, - disable = { 'yaml' } + -- Disable by languages, see `Supported languages` + disable = { "yaml" }, + + -- Whether to enable lazy mode (recommend to enable this if bad indent happens frequently) + default_lazy = true, + + -- Determine the fallback method used when we cannot calculate indent by tree-sitter + -- "auto": fallback to vim auto indent + -- "asis": use current indent as-is + -- "cindent": see `:h cindent()` + -- Or a custom function return the final indent result. + default_fallback = "auto" + }, + indent = { + enable = false -- disable builtin indent module } } + diff --git a/lua/plug.lua b/lua/plug.lua index 2e2c78d..e4b18a3 100644 --- a/lua/plug.lua +++ b/lua/plug.lua @@ -4,6 +4,7 @@ return require('packer').startup(function(use) use 'wbthomason/packer.nvim' use 'folke/tokyonight.nvim' use 'kyazdani42/nvim-web-devicons' + use 'leafOfTree/vim-svelte-plugin' use { 'nvim-telescope/telescope.nvim', tag = '0.1.0', requires = { {'nvim-lua/plenary.nvim'} } @@ -31,6 +32,7 @@ return require('packer').startup(function(use) use 'SmiteshP/nvim-navic' -- show filepath at top -- copy pasted from https://rsdlt.github.io/posts/rust-nvim-ide-guide-walkthrough-development-debug/ + -- code completion use 'hrsh7th/nvim-cmp' -- LSP completion source: @@ -56,4 +58,6 @@ return require('packer').startup(function(use) config = function() require("nvim-autopairs").setup {} end } use 'kylechui/nvim-surround' + use { "yioneko/nvim-yati", tag = "*", requires = "nvim-treesitter/nvim-treesitter" } + use 'moll/vim-bbye' end) diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index 7aa8ed6..4706f79 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -109,6 +109,11 @@ _G.packer_plugins = { path = "/Users/zev/.local/share/nvim/site/pack/packer/start/coc.nvim", url = "https://github.com/neoclide/coc.nvim" }, + ["git-blame.vim"] = { + loaded = true, + path = "/Users/zev/.local/share/nvim/site/pack/packer/start/git-blame.vim", + url = "https://github.com/zivyangll/git-blame.vim" + }, ["hlargs.nvim"] = { loaded = true, path = "/Users/zev/.local/share/nvim/site/pack/packer/start/hlargs.nvim", @@ -150,6 +155,16 @@ _G.packer_plugins = { path = "/Users/zev/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", url = "https://github.com/neovim/nvim-lspconfig" }, + ["nvim-navic"] = { + loaded = true, + path = "/Users/zev/.local/share/nvim/site/pack/packer/start/nvim-navic", + url = "https://github.com/SmiteshP/nvim-navic" + }, + ["nvim-surround"] = { + loaded = true, + path = "/Users/zev/.local/share/nvim/site/pack/packer/start/nvim-surround", + url = "https://github.com/kylechui/nvim-surround" + }, ["nvim-test"] = { config = { "\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14nvim-test\frequire\0" }, loaded = true, @@ -166,6 +181,11 @@ _G.packer_plugins = { path = "/Users/zev/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", url = "https://github.com/kyazdani42/nvim-web-devicons" }, + ["nvim-yati"] = { + loaded = true, + path = "/Users/zev/.local/share/nvim/site/pack/packer/start/nvim-yati", + url = "https://github.com/yioneko/nvim-yati" + }, ["packer.nvim"] = { loaded = true, path = "/Users/zev/.local/share/nvim/site/pack/packer/start/packer.nvim", @@ -191,6 +211,11 @@ _G.packer_plugins = { path = "/Users/zev/.local/share/nvim/site/pack/packer/start/tokyonight.nvim", url = "https://github.com/folke/tokyonight.nvim" }, + ["vim-bbye"] = { + loaded = true, + path = "/Users/zev/.local/share/nvim/site/pack/packer/start/vim-bbye", + url = "https://github.com/moll/vim-bbye" + }, ["vim-commentary"] = { loaded = true, path = "/Users/zev/.local/share/nvim/site/pack/packer/start/vim-commentary", @@ -206,6 +231,11 @@ _G.packer_plugins = { path = "/Users/zev/.local/share/nvim/site/pack/packer/start/vim-illuminate", url = "https://github.com/RRethy/vim-illuminate" }, + ["vim-svelte-plugin"] = { + loaded = true, + path = "/Users/zev/.local/share/nvim/site/pack/packer/start/vim-svelte-plugin", + url = "https://github.com/leafOfTree/vim-svelte-plugin" + }, ["vim-vsnip"] = { loaded = true, path = "/Users/zev/.local/share/nvim/site/pack/packer/start/vim-vsnip", @@ -219,14 +249,14 @@ _G.packer_plugins = { } time([[Defining packer_plugins]], false) --- Config for: nvim-autopairs -time([[Config for nvim-autopairs]], true) -try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") -time([[Config for nvim-autopairs]], false) -- Config for: nvim-test time([[Config for nvim-test]], true) try_loadstring("\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14nvim-test\frequire\0", "config", "nvim-test") time([[Config for nvim-test]], false) +-- Config for: nvim-autopairs +time([[Config for nvim-autopairs]], true) +try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") +time([[Config for nvim-autopairs]], false) _G._packer.inside_compile = false if _G._packer.needs_bufread == true then