improve nvim folding and update alacritty config
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
- starship
|
||||
- tmux
|
||||
- tmux-plugin-manager
|
||||
- python3-libtmux
|
||||
- neovim
|
||||
- lua-language-server
|
||||
- stylua
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import = ["~/.config/alacritty/dracula.toml"]
|
||||
|
||||
[font]
|
||||
size = 13.0
|
||||
|
||||
|
||||
@@ -50,12 +50,15 @@ vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches
|
||||
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.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.opt.foldtext = ""
|
||||
-- Nice and simple folding:
|
||||
vim.opt.foldenable = true
|
||||
vim.opt.foldlevel = 99
|
||||
vim.opt.foldlevelstart = 99
|
||||
vim.opt.foldnestmax = 6
|
||||
vim.opt.foldmethod = "expr"
|
||||
-- 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
|
||||
|
||||
-- remove trailing whitespace
|
||||
|
||||
@@ -16,6 +16,21 @@ vim.lsp.config("rust", {
|
||||
vim.lsp.enable("luals")
|
||||
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
|
||||
vim.o.completeopt = "menuone,noinsert,popup,fuzzy"
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
|
||||
Reference in New Issue
Block a user