This commit is contained in:
2022-11-17 14:54:28 +01:00
parent 1ea6577635
commit bfedcc8a55
5 changed files with 103 additions and 11 deletions

View File

@@ -0,0 +1,3 @@
{
"suggest.enablePreselect": false
}

View File

@@ -10,13 +10,20 @@ vim.g.mapleader = ' '
nnoremap("<leader>pv", "<cmd>Ex<CR>")
nnoremap("<leader>pk", "<cmd>PackerSync<CR>")
nnoremap("<c-s>", "<cmd>w<CR>")
nnoremap("<leader>w", "<cmd>bw<cr>")
nnoremap("<leader>w", ":Bdelete<cr>")
nnoremap("<leader>h", "<c-w>h")
nnoremap("<leader>l", "<c-w>l")
nnoremap("<leader>j", "<c-w>j")
nnoremap("<leader>k", "<c-w>k")
-- xnoremap("<leader>p", "\"_dP")
nnoremap("<leader>v", ":vspl<cr>")
nnoremap("<leader>c", ":spl<cr>")
nnoremap("<leader>k", ":e ~/.config/nvim/lua/keys.lua<cr>")
nnoremap("<leader>m", ":e ~/.config/nvim/lua/keys.lua<cr>")
nnoremap("<leader>o", ":e ~/.config/nvim/lua/opts.lua<cr>")
nnoremap("<leader>i", ":e ~/.config/nvim/init.lua<cr>")
nnoremap("<leader>p", ":e ~/.config/nvim/lua/plug.lua<cr>")
nnoremap("gf", ":e <cfile><cr>")
-- FloaTerm configuration
nmap("<leader>t", ":FloatermNew --name=myfloat --height=0.85 --width=0.75 --autoclose=2 bash <CR>")
@@ -33,7 +40,10 @@ nnoremap("<c-l>", ":bn<cr>")
nnoremap("<c-e>", ":noh<cr>")
-- run rust tests
nmap("<leader>r", ":FloatermNew --name=myfloat --height=0.85 --width=0.75 --autoclose=2 bash <cr>cargo test<cr>")
-- nmap("<leader>r", ":FloatermNew --name=myfloat --height=0.85 --width=0.75 --autoclose=2 bash <cr>cargo test<cr>")
-- run python tests
nmap("<leader>r", ":FloatermNew --name=myfloat --height=0.85 --width=0.75 --autoclose=2 bash <cr>pytest<cr>")
-- Telescope
nnoremap("<leader>f", "<cmd>lua require('telescope.builtin').find_files()<cr>")
@@ -43,7 +53,7 @@ nnoremap("<leader>b", "<cmd>lua require('telescope.builtin').buffers()<cr>")
-- source current file
nnoremap("<leader>s", "<cmd>source<cr>")
nmap("<leader>l", ":call CocAction('diagnosticNext')<cr>")
nmap("<leader>n", ":call CocAction('diagnosticNext')<cr>")
nmap("gd", ":call CocAction('jumpDefinition')<cr>")
-- In insert or command mode, move normally by using Ctrl

View File

@@ -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
}
}

View File

@@ -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)

View File

@@ -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