1
0

improve nvim folding and update alacritty config

This commit is contained in:
2025-03-29 19:39:46 +01:00
parent 407f9c2c96
commit bffcdd8460
4 changed files with 24 additions and 7 deletions

View File

@@ -10,6 +10,7 @@
- starship - starship
- tmux - tmux
- tmux-plugin-manager - tmux-plugin-manager
- python3-libtmux
- neovim - neovim
- lua-language-server - lua-language-server
- stylua - stylua

View File

@@ -1,5 +1,3 @@
import = ["~/.config/alacritty/dracula.toml"]
[font] [font]
size = 13.0 size = 13.0

View File

@@ -50,12 +50,15 @@ vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches
vim.opt.formatoptions:remove({ "c", "r", "o" }) vim.opt.formatoptions:remove({ "c", "r", "o" })
vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins from neovim in case vim still in use vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins from neovim in case vim still in use
vim.opt.foldmethod = "expr" -- Nice and simple folding:
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" vim.opt.foldenable = true
vim.opt.foldtext = ""
vim.opt.foldlevel = 99 vim.opt.foldlevel = 99
vim.opt.foldlevelstart = 99 vim.opt.foldmethod = "expr"
vim.opt.foldnestmax = 6 -- Default to treesitter folding
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
-- vim.opt.foldtext = "> "
vim.opt.fillchars:append({ fold = ">" })
vim.opt.incsearch = true -- search as characters are entered vim.opt.incsearch = true -- search as characters are entered
-- remove trailing whitespace -- remove trailing whitespace

View File

@@ -16,6 +16,21 @@ vim.lsp.config("rust", {
vim.lsp.enable("luals") vim.lsp.enable("luals")
vim.lsp.enable("rust") vim.lsp.enable("rust")
-- [[FOLDING SETUP
-- Prefer LSP folding if client supports it
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client ~= nil then
if client:supports_method("textDocument/foldingRange") then
local win = vim.api.nvim_get_current_win()
vim.wo[win][0].foldexpr = "v:lua.vim.lsp.foldexpr()"
end
end
end,
})
-- ]]
---[[AUTOCOMPLETION SETUP ---[[AUTOCOMPLETION SETUP
vim.o.completeopt = "menuone,noinsert,popup,fuzzy" vim.o.completeopt = "menuone,noinsert,popup,fuzzy"
vim.api.nvim_create_autocmd("LspAttach", { vim.api.nvim_create_autocmd("LspAttach", {