nvim lazy conf almost finished
This commit is contained in:
parent
be07ce0344
commit
5335419073
9 changed files with 126 additions and 186 deletions
|
@ -1,6 +0,0 @@
|
||||||
require 'colorizer'.setup({
|
|
||||||
'dosini';
|
|
||||||
'css';
|
|
||||||
'javascript';
|
|
||||||
html = { mode = 'background' };
|
|
||||||
})
|
|
|
@ -1 +1,4 @@
|
||||||
require("fidget").setup()
|
return {
|
||||||
|
"j-hui/fidget.nvim",
|
||||||
|
config = true
|
||||||
|
}
|
||||||
|
|
|
@ -1,51 +1,24 @@
|
||||||
local present, mason = pcall(require, "mason")
|
return {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = "williamboman/mason-lspconfig.nvim",
|
||||||
|
config = function()
|
||||||
|
local mason_lspconfig = require "mason-lspconfig"
|
||||||
|
|
||||||
vim.api.nvim_create_augroup("_mason", { clear = true })
|
mason_lspconfig.setup({
|
||||||
|
|
||||||
local options = {
|
|
||||||
PATH = "skip",
|
|
||||||
|
|
||||||
ui = {
|
|
||||||
icons = {
|
|
||||||
package_installed = "✓",
|
|
||||||
package_pending = "➜",
|
|
||||||
package_uninstalled = "✗"
|
|
||||||
},
|
|
||||||
|
|
||||||
keymaps = {
|
|
||||||
toggle_server_expand = "<CR>",
|
|
||||||
install_server = "i",
|
|
||||||
update_server = "u",
|
|
||||||
check_server_version = "c",
|
|
||||||
update_all_servers = "U",
|
|
||||||
check_outdated_servers = "C",
|
|
||||||
uninstall_server = "X",
|
|
||||||
cancel_installation = "<C-c>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
max_concurrent_installers = 10,
|
|
||||||
}
|
|
||||||
|
|
||||||
mason.setup(options)
|
|
||||||
|
|
||||||
local mason_lspconfig = require "mason-lspconfig"
|
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
|
||||||
ensure_installed = {},
|
ensure_installed = {},
|
||||||
automatic_installation = true
|
automatic_installation = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||||
|
|
||||||
-- Use an on_attach function to only map the following keys
|
-- Use an on_attach function to only map the following keys
|
||||||
-- after the language server attaches to the current buffer
|
-- after the language server attaches to the current buffer
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
@ -69,21 +42,21 @@ local on_attach = function(client, bufnr)
|
||||||
vim.keymap.set('n', '<space>ge', function() vim.diagnostic.goto_next() end, bufopts)
|
vim.keymap.set('n', '<space>ge', function() vim.diagnostic.goto_next() end, bufopts)
|
||||||
vim.keymap.set('n', '<space>gE', function() vim.diagnostic.goto_prev() end, bufopts)
|
vim.keymap.set('n', '<space>gE', function() vim.diagnostic.goto_prev() end, bufopts)
|
||||||
vim.keymap.set('n', '<space>fo', function() vim.lsp.buf.format { async = true } end, bufopts)
|
vim.keymap.set('n', '<space>fo', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
end
|
end
|
||||||
|
|
||||||
local lspconfig = require "lspconfig"
|
local lspconfig = require "lspconfig"
|
||||||
|
|
||||||
-- ADD NVIM CMP AS A CAPABILITY
|
-- ADD NVIM CMP AS A CAPABILITY
|
||||||
local lsp_defaults = lspconfig.util.default_config
|
local lsp_defaults = lspconfig.util.default_config
|
||||||
|
|
||||||
local capabilities = vim.tbl_deep_extend(
|
local capabilities = vim.tbl_deep_extend(
|
||||||
'force',
|
'force',
|
||||||
lsp_defaults.capabilities,
|
lsp_defaults.capabilities,
|
||||||
require('cmp_nvim_lsp').default_capabilities()
|
require('cmp_nvim_lsp').default_capabilities()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
mason_lspconfig.setup_handlers {
|
mason_lspconfig.setup_handlers {
|
||||||
|
|
||||||
-- This is a default handler that will be called for each installed server (also for new servers that are installed during a session)
|
-- This is a default handler that will be called for each installed server (also for new servers that are installed during a session)
|
||||||
function(server_name)
|
function(server_name)
|
||||||
|
@ -94,4 +67,6 @@ mason_lspconfig.setup_handlers {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,8 @@ return {
|
||||||
}
|
}
|
||||||
|
|
||||||
require('orgmode').setup({
|
require('orgmode').setup({
|
||||||
org_agenda_files = { '~/Nextcloud/Documents/uni/**/*' },
|
org_agenda_files = { '~/Nextcloud/org/**/*' },
|
||||||
org_default_notes_file = '~/Nextcloud/Documents/uni/refile.org',
|
org_default_notes_file = '~/Nextcloud/org/refile.org',
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
return {
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
config = function()
|
|
||||||
require('lualine').setup {
|
|
||||||
options = {
|
|
||||||
icons_enabled = true,
|
|
||||||
theme = 'auto',
|
|
||||||
component_separators = { left = '', right = '' },
|
|
||||||
section_separators = { left = '', right = '' },
|
|
||||||
disabled_filetypes = {
|
|
||||||
statusline = {},
|
|
||||||
winbar = {},
|
|
||||||
},
|
|
||||||
ignore_focus = {},
|
|
||||||
always_divide_middle = true,
|
|
||||||
globalstatus = false,
|
|
||||||
refresh = {
|
|
||||||
statusline = 1000,
|
|
||||||
tabline = 1000,
|
|
||||||
winbar = 1000,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = { 'mode' },
|
|
||||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
|
||||||
lualine_c = { 'filename' },
|
|
||||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
|
||||||
lualine_y = { 'progress' },
|
|
||||||
lualine_z = { 'location' }
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = {},
|
|
||||||
lualine_b = {},
|
|
||||||
lualine_c = { 'filename' },
|
|
||||||
lualine_x = { 'location' },
|
|
||||||
lualine_y = {},
|
|
||||||
lualine_z = {}
|
|
||||||
},
|
|
||||||
tabline = {},
|
|
||||||
winbar = {},
|
|
||||||
inactive_winbar = {},
|
|
||||||
extensions = {}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
|
@ -1,5 +1,13 @@
|
||||||
local builtin = require('telescope.builtin')
|
return {
|
||||||
vim.keymap.set('n', '<leader>sf', builtin.find_files, {})
|
"nvim-telescope/telescope.nvim",
|
||||||
vim.keymap.set('n', '<leader>sg', builtin.live_grep, {})
|
dependencies = {
|
||||||
vim.keymap.set('n', '<leader>sb', builtin.buffers, {})
|
"nvim-lua/plenary.nvim"
|
||||||
vim.keymap.set('n', '<leader>sh', builtin.help_tags, {})
|
},
|
||||||
|
config = function()
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
vim.keymap.set('n', '<leader>sf', builtin.find_files, {})
|
||||||
|
vim.keymap.set('n', '<leader>sg', builtin.live_grep, {})
|
||||||
|
vim.keymap.set('n', '<leader>sb', builtin.buffers, {})
|
||||||
|
vim.keymap.set('n', '<leader>sh', builtin.help_tags, {})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
function ContextSetup(show_all_context)
|
return {
|
||||||
|
"romgrk/nvim-treesitter-context",
|
||||||
|
config = function()
|
||||||
require("treesitter-context").setup({
|
require("treesitter-context").setup({
|
||||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||||
throttle = true, -- Throttles plugin updates (may improve performance)
|
throttle = true, -- Throttles plugin updates (may improve performance)
|
||||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||||
show_all_context = show_all_context,
|
show_all_context = false,
|
||||||
patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
|
patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
|
||||||
-- For all filetypes
|
-- For all filetypes
|
||||||
-- Note that setting an entry here replaces all other patterns for this entry.
|
-- Note that setting an entry here replaces all other patterns for this entry.
|
||||||
|
@ -31,6 +33,5 @@ function ContextSetup(show_all_context)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
}
|
||||||
ContextSetup(false)
|
|
||||||
|
|
|
@ -1 +1,7 @@
|
||||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
return {
|
||||||
|
"mbbill/undotree",
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||||
|
end
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
vim.g.vimtex_view_method = 'zathura'
|
|
||||||
vim.g.vimtex_compiler_methor = 'latexmk'
|
|
Loading…
Add table
Reference in a new issue