feat: config
This commit is contained in:
commit
d47035b8c7
11 changed files with 421 additions and 0 deletions
63
after/plugin/lsp.lua
Normal file
63
after/plugin/lsp.lua
Normal file
|
@ -0,0 +1,63 @@
|
|||
local lspconfig = require('lspconfig')
|
||||
local fidget = require('fidget')
|
||||
local nlcmp = require('cmp_nvim_lsp')
|
||||
local cmp = require('cmp')
|
||||
local map = vim.keymap.set
|
||||
|
||||
vim.opt.signcolumn = 'yes'
|
||||
|
||||
local lc_defaults = lspconfig.util.default_config
|
||||
lc_defaults.capabilities = vim.tbl_deep_extend(
|
||||
'force',
|
||||
lc_defaults.capabilities,
|
||||
nlcmp.default_capabilities()
|
||||
)
|
||||
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer', keyword_length = 3 }, -- only start autocompleting after a few chars typed
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
-- You need Neovim v0.10 to use vim.snippet
|
||||
vim.snippet.expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<cr>'] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
}
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
desc = 'LSP actions (apparently)',
|
||||
callback = function(event)
|
||||
fidget.notify("LSP attached to current buffer.", nil, nil)
|
||||
|
||||
local opts = { buffer = event.buf }
|
||||
|
||||
map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
|
||||
map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
|
||||
map('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
|
||||
map('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
|
||||
map('n', 'gf', '<cmd>lua vim.lsp.buf.format({async = false, timeout_ms = 10000})<cr>', opts)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- lspconfig.lua_ls.setup({})
|
||||
-- lspconfig.rust_analyzer.setup({})
|
||||
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = { "lua_ls", "gopls", "html", "nim_langserver", "eslint", "clangd" },
|
||||
handlers = {
|
||||
function(svn)
|
||||
lspconfig[svn].setup({})
|
||||
end,
|
||||
}
|
||||
})
|
23
after/plugin/telescope.lua
Normal file
23
after/plugin/telescope.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
local telescope = require('telescope')
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
local ignore_pattern = {"*.class", "*.jar"}
|
||||
local final_command = {"find", "."}
|
||||
|
||||
for _, patt in ipairs(ignore_pattern) do
|
||||
table.insert(final_command, "-not")
|
||||
table.insert(final_command, "-name")
|
||||
table.insert(final_command, patt)
|
||||
end
|
||||
|
||||
telescope.setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
find_command = final_command,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader><leader>', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>g', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>d', builtin.buffers, {})
|
27
after/plugin/theme.lua
Normal file
27
after/plugin/theme.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
require("rose-pine").setup({
|
||||
variant = "auto",
|
||||
dark_variant = "moon",
|
||||
extend_background_behind_borders = true,
|
||||
|
||||
enable = {
|
||||
terminal = true,
|
||||
legacy_highlights = true, -- Improve compatibility for previous versions of Neovim
|
||||
migrations = true, -- Handle deprecated options automatically
|
||||
},
|
||||
|
||||
styles = {
|
||||
bold = true,
|
||||
italic = true,
|
||||
transparency = true,
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
require('lualine').setup({})
|
||||
|
||||
function ColorMyPencils(color) -- skidded from theprimeagen
|
||||
colors = color or "catppuccin"
|
||||
vim.cmd.colorscheme(color)
|
||||
end
|
||||
|
||||
ColorMyPencils("rose-pine")
|
16
after/plugin/treesitter.lua
Normal file
16
after/plugin/treesitter.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
||||
ensure_installed = { "typescript", "javascript", "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue