nvim: auto/smart-indent on vim is sooo bad
parent
4b9cac1603
commit
0118ded1bf
|
@ -70,7 +70,7 @@
|
||||||
username = "nixos";
|
username = "nixos";
|
||||||
homeDirectory = "/home/nixos";
|
homeDirectory = "/home/nixos";
|
||||||
shellInitExtra = ''
|
shellInitExtra = ''
|
||||||
'' + x11_wsl;
|
'' + x11_wsl;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,7 @@ Plug('hrsh7th/cmp-buffer')
|
||||||
Plug('hrsh7th/cmp-cmdline')
|
Plug('hrsh7th/cmp-cmdline')
|
||||||
Plug('hrsh7th/nvim-cmp')
|
Plug('hrsh7th/nvim-cmp')
|
||||||
Plug('onsails/lspkind-nvim')
|
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' })
|
-- Plug('tzachar/cmp-tabnine', { ['do'] = './install.sh' })
|
||||||
|
|
||||||
-- DevExp
|
-- DevExp
|
||||||
|
@ -79,6 +79,8 @@ Plug('folke/todo-comments.nvim') -- Highlights TODO
|
||||||
|
|
||||||
-- other utilities
|
-- other utilities
|
||||||
Plug('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
|
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('saadparwaiz1/cmp_luasnip') -- snippet engine
|
||||||
Plug('L3MON4D3/LuaSnip') -- snippet engine
|
Plug('L3MON4D3/LuaSnip') -- snippet engine
|
||||||
Plug('mickael-menu/zk-nvim') -- Zettelkasten
|
Plug('mickael-menu/zk-nvim') -- Zettelkasten
|
||||||
|
@ -87,9 +89,9 @@ Plug('mickael-menu/zk-nvim') -- Zettelkasten
|
||||||
vim.call('plug#end')
|
vim.call('plug#end')
|
||||||
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
||||||
\| PlugInstall --sync | autocmd VimEnter * so $MYVIMRC
|
PlugInstall --sync | autocmd VimEnter * so $MYVIMRC
|
||||||
\| endif
|
endif
|
||||||
]])
|
]])
|
||||||
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
|
@ -97,6 +99,7 @@ set number relativenumber
|
||||||
set tabstop=4 softtabstop=4
|
set tabstop=4 softtabstop=4
|
||||||
set expandtab
|
set expandtab
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
|
set autoindent
|
||||||
set smartindent
|
set smartindent
|
||||||
set exrc
|
set exrc
|
||||||
set incsearch
|
set incsearch
|
||||||
|
@ -115,6 +118,9 @@ vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||||
vim.opt.undofile = true
|
vim.opt.undofile = true
|
||||||
vim.opt.completeopt = 'menuone,noselect'
|
vim.opt.completeopt = 'menuone,noselect'
|
||||||
-- vim.opt.clipboard = "unnamedplus"
|
-- 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.mapleader = ' '
|
||||||
vim.g.maplocalleader = ','
|
vim.g.maplocalleader = ','
|
||||||
|
@ -280,13 +286,17 @@ remap('n', '<leader>zg', function()
|
||||||
end, { desc = '[Z]ettelkasten [G]rep' })
|
end, { desc = '[Z]ettelkasten [G]rep' })
|
||||||
|
|
||||||
-- treesitter
|
-- treesitter
|
||||||
|
require 'treesitter-context'
|
||||||
require('nvim-treesitter.configs').setup {
|
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 },
|
indent = { enable = false },
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
'tsx', 'toml', 'lua', 'typescript', 'rust', 'go', 'yaml', 'json', 'php', 'css',
|
'tsx', 'toml', 'lua', 'typescript', 'rust', 'go', 'yaml', 'json', 'php', 'css',
|
||||||
'python', 'prisma', 'html', "dockerfile", "c", "cpp", "hcl", "svelte", "astro",
|
'python', 'prisma', 'html', "dockerfile", "c", "cpp", "hcl", "svelte", "astro",
|
||||||
"clojure", "fennel", "bash", "nix"
|
"clojure", "fennel", "bash", "nix", "query",
|
||||||
},
|
},
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
|
@ -422,8 +432,8 @@ local on_attach = function(client, bufnr)
|
||||||
nmap('<leader>wl', function()
|
nmap('<leader>wl', function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
|
||||||
-- enable inlay hints if available
|
-- enable inlay hints if available
|
||||||
require('inlay-hints').on_attach(client, bufnr)
|
require('inlay-hints').on_attach(client, bufnr)
|
||||||
end, '[W]orkspace [L]ist Folders')
|
end, '[W]orkspace [L]ist Folders')
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -515,7 +525,7 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
-- default language servers
|
-- default language servers
|
||||||
local servers = {
|
local servers = {
|
||||||
'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua', 'cmake', 'tailwindcss', 'prismals',
|
'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua', 'cmake', 'tailwindcss', 'prismals',
|
||||||
'rnix', 'eslint', 'terraformls', 'tflint', 'svelte', 'astro', 'clojure_lsp', "bashls", 'yamlls', "pylsp" ,
|
'rnix', 'eslint', 'terraformls', 'tflint', 'svelte', 'astro', 'clojure_lsp', "bashls", 'yamlls', "pylsp",
|
||||||
}
|
}
|
||||||
require("mason").setup({
|
require("mason").setup({
|
||||||
ui = {
|
ui = {
|
||||||
|
@ -566,7 +576,7 @@ require('mason-lspconfig').setup_handlers({
|
||||||
library = vim.api.nvim_get_runtime_file('', true)
|
library = vim.api.nvim_get_runtime_file('', true)
|
||||||
},
|
},
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
hint = {enable = true,},
|
hint = { enable = true, },
|
||||||
format = {
|
format = {
|
||||||
enable = true,
|
enable = true,
|
||||||
defaultConfig = {
|
defaultConfig = {
|
||||||
|
@ -626,7 +636,7 @@ require("rust-tools").setup {
|
||||||
-- callback to execute once rust-analyzer is done initializing the workspace
|
-- callback to execute once rust-analyzer is done initializing the workspace
|
||||||
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
|
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
|
||||||
on_initialized = function()
|
on_initialized = function()
|
||||||
require ('inlay-hints').set_all()
|
require('inlay-hints').set_all()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
|
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
|
||||||
|
@ -899,4 +909,3 @@ require('nvim-surround').setup {}
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
let g:conjure#mapping#doc_word = v:false
|
let g:conjure#mapping#doc_word = v:false
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue