nvim: auto/smart-indent on vim is sooo bad

nix-components
pegasust 2022-11-23 17:18:38 -07:00
parent 4b9cac1603
commit 0118ded1bf
2 changed files with 23 additions and 14 deletions

View File

@ -45,7 +45,7 @@ Plug('hrsh7th/cmp-buffer')
Plug('hrsh7th/cmp-cmdline')
Plug('hrsh7th/nvim-cmp')
Plug('onsails/lspkind-nvim')
Plug('yioneko/nvim-yati', { tag = '*'}) -- hopefully fixes Python indentation auto-correct from Tree-sitter
Plug('yioneko/nvim-yati', { tag = '*' }) -- copium: fix Python indent auto-correct from smart-indent
-- Plug('tzachar/cmp-tabnine', { ['do'] = './install.sh' })
-- DevExp
@ -79,6 +79,8 @@ Plug('folke/todo-comments.nvim') -- Highlights TODO
-- other utilities
Plug('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
Plug('nvim-treesitter/nvim-treesitter-context') -- Top one-liner context of func/class scope
Plug('nvim-treesitter/playground') -- Sees Treesitter AST - less hair pulling, more PRs
Plug('saadparwaiz1/cmp_luasnip') -- snippet engine
Plug('L3MON4D3/LuaSnip') -- snippet engine
Plug('mickael-menu/zk-nvim') -- Zettelkasten
@ -88,8 +90,8 @@ vim.call('plug#end')
vim.cmd([[
if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | autocmd VimEnter * so $MYVIMRC
\| endif
PlugInstall --sync | autocmd VimEnter * so $MYVIMRC
endif
]])
vim.cmd([[
@ -97,6 +99,7 @@ set number relativenumber
set tabstop=4 softtabstop=4
set expandtab
set shiftwidth=4
set autoindent
set smartindent
set exrc
set incsearch
@ -115,6 +118,9 @@ vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.completeopt = 'menuone,noselect'
-- vim.opt.clipboard = "unnamedplus"
-- more aggressive swap file writing. ThePrimeagen believes higher number
-- leads to low DX
vim.opt.updatetime = 50
vim.g.mapleader = ' '
vim.g.maplocalleader = ','
@ -280,13 +286,17 @@ remap('n', '<leader>zg', function()
end, { desc = '[Z]ettelkasten [G]rep' })
-- treesitter
require 'treesitter-context'
require('nvim-treesitter.configs').setup {
yati = { enable = true, default_lazy = true, default_fallback = "auto"},
yati = {
enable = true, default_lazy = true, default_fallback = "auto",
disable = { "nix" }
},
indent = { enable = false },
ensure_installed = {
'tsx', 'toml', 'lua', 'typescript', 'rust', 'go', 'yaml', 'json', 'php', 'css',
'python', 'prisma', 'html', "dockerfile", "c", "cpp", "hcl", "svelte", "astro",
"clojure", "fennel", "bash", "nix"
"clojure", "fennel", "bash", "nix", "query",
},
sync_install = false,
highlight = { enable = true },
@ -899,4 +909,3 @@ require('nvim-surround').setup {}
vim.cmd([[
let g:conjure#mapping#doc_word = v:false
]])