chore: cleanup of nvim

This commit is contained in:
Fabio Lenherr / DashieTM 2023-02-20 22:30:37 +01:00
parent 511dabde0f
commit 6984aa64e8
6 changed files with 36 additions and 14 deletions

View file

@ -5,6 +5,7 @@
"global" "global"
], ],
"Lua.workspace.library": [ "Lua.workspace.library": [
"${3rd}/luassert/library" "${3rd}/luassert/library",
"${3rd}/luv/library"
] ]
} }

View file

@ -110,6 +110,7 @@ require("dapui").setup({
max_value_lines = 100, -- Can be integer or nil. max_value_lines = 100, -- Can be integer or nil.
}, },
}) })
require("mason-nvim-dap").setup({ require("mason-nvim-dap").setup({
ensure_installed = { ensure_installed = {
"bash-debug-adapter", "bash-debug-adapter",
@ -118,4 +119,5 @@ require("mason-nvim-dap").setup({
"node-debug2-adapter", "node-debug2-adapter",
}, },
}) })
require("nvim-dap-virtual-text").setup() require("nvim-dap-virtual-text").setup()

View file

@ -18,7 +18,7 @@ require("mason-lspconfig").setup({
"cssls", -- css "cssls", -- css
"html", -- html "html", -- html
"clangd", -- cpp / c "clangd", -- cpp / c
"sumneko_lua", -- lua "lua_ls", -- lua
"pyright", -- python "pyright", -- python
"cmake", -- cmake "cmake", -- cmake
"bashls", -- shell "bashls", -- shell
@ -28,7 +28,12 @@ require("mason-lspconfig").setup({
"tsserver", -- js and ts "tsserver", -- js and ts
"ltex", -- latex "ltex", -- latex
"jdtls", -- jafuck "jdtls", -- jafuck
"gopls" -- yet another gargabe collector "gopls", -- yet another gargabe collector
"sqls", -- sql
"taplo", -- toml
"lemminx", -- xml
"yamlls", -- yaml
"bashls", -- shell
}, },
automatic_installation = true, automatic_installation = true,
}) })

View file

@ -19,11 +19,9 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
hijack_cursor = false, hijack_cursor = false,
hijack_netrw = true, hijack_netrw = true,
hijack_unnamed_buffer_when_opening = false, hijack_unnamed_buffer_when_opening = false,
ignore_buffer_on_setup = false,
open_on_setup = false, open_on_setup = false,
open_on_setup_file = false, open_on_setup_file = false,
open_on_tab = false, open_on_tab = false,
ignore_buf_on_tab_change = {},
sort_by = "name", sort_by = "name",
root_dirs = {}, root_dirs = {},
prefer_startup_root = false, prefer_startup_root = false,
@ -241,3 +239,27 @@ vim.api.nvim_create_autocmd("BufEnter", {
end end
end end
}) })
local function open_nvim_tree(data)
-- buffer is a [No Name]
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
-- buffer is a directory
local directory = vim.fn.isdirectory(data.file) == 1
if not no_name and not directory then
return
end
-- change to the directory
if directory then
vim.cmd.cd(data.file)
end
-- open the tree
require("nvim-tree.api").tree.open()
end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })

View file

@ -19,7 +19,7 @@ local options = {
tabstop = 2, -- insert 2 spaces for a tab tabstop = 2, -- insert 2 spaces for a tab
scrolloff = 8, scrolloff = 8,
sidescrolloff = 8, sidescrolloff = 8,
spell = true, spell = false,
syntax = "off", syntax = "off",
spelllang = "en_us", spelllang = "en_us",
mousemodel = "popup_setpos", mousemodel = "popup_setpos",

View file

@ -4,17 +4,9 @@ if not status_ok then
end end
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all"
ensure_installed = "all", ensure_installed = "all",
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
}) })
local status_ok2, _ = pcall(require, "spellsitter")
if not status_ok2 then
return
end
require("spellsitter").setup()