-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update release new version of lsp/mason, etc
- Loading branch information
1 parent
778d940
commit d2cfe1f
Showing
10 changed files
with
180 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
require("config.init") | ||
require("keymap.key") | ||
vim.cmd('set number') | ||
vim.keymap.set('v', '<Leader>1f', vim.lsp.buf.format, bufopts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
local cmp = require("cmp") | ||
require("luasnip.loaders.from_vscode").lazy_load() | ||
cmp.setup({ | ||
mapping = cmp.mapping.preset.insert({ | ||
['<C-b>'] = cmp.mapping.scroll_docs(-4), | ||
['<C-f>'] = cmp.mapping.scroll_docs(4), | ||
['<C-Space>'] = cmp.mapping.complete(), | ||
['<C-e>'] = cmp.mapping.abort(), | ||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. | ||
}), | ||
snippet = { | ||
expand = function(args) | ||
require("luasnip").lsp_expand(args.body) | ||
end, | ||
}, | ||
sources = cmp.config.sources({ | ||
{ name = 'nvim_lsp' }, | ||
{ name = 'luasnip' }, | ||
{ name = 'buffer' }, | ||
{ name = 'codeium' }, | ||
}), | ||
formatting = { | ||
format = require('lspkind').cmp_format({ | ||
mode = "symbol", | ||
maxwidth = 50, | ||
ellipsis_char = '...', | ||
symbol_map = { Codeium = "", }, | ||
}), | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require("mason").setup({}) | ||
require("mason-lspconfig").setup({ | ||
ensured_install = { | ||
"lua_ls", "pyright", | ||
"vimls", | ||
}, | ||
}) | ||
local on_attach = function(_, _) | ||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {}) | ||
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, {}) | ||
|
||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {}) | ||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {}) | ||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, {}) | ||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {}) | ||
end | ||
|
||
local capabilities = require("cmp_nvim_lsp").default_capabilities() | ||
|
||
require("lspconfig").lua_ls.setup({ | ||
on_attach = on_attach, | ||
capabilities = capabilities, | ||
}) | ||
require("lspconfig").pyright.setup({ | ||
on_attach = on_attach, | ||
capabilities = capabilities, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
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 = {} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require("nvim-tree").setup() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
local ls = require("luasnip") | ||
local s = ls.snippet | ||
local t = ls.text_node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require('nvim-treesitter.configs').setup { | ||
-- A list of parser names, or "all" (the five listed parsers should always be installed) | ||
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "python" }, | ||
|
||
-- 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, | ||
|
||
-- List of parsers to ignore installing (or "all") | ||
ignore_install = { "javascript" }, | ||
|
||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup) | ||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! | ||
|
||
highlight = { | ||
enable = true, | ||
|
||
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to | ||
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is | ||
-- the name of the parser) | ||
-- list of language that will be disabled | ||
disable = { "c", "rust" }, | ||
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files | ||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. | ||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). | ||
-- Using this option may slow down your editor, and you may see some duplicate highlights. | ||
-- Instead of true it can also be a list of languages | ||
additional_vim_regex_highlighting = false, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
local map = vim.keymap.set | ||
map("n", "<leader>ff", "<cmd>Telescope fd<CR>") | ||
map("n", "<leader>th", "<cmd>Telescope colorscheme<CR>") | ||
map("n", "<C-n>", "<cmd>NvimTreeToggle<CR>", { desc = "Nvimtree Toggle window" }) | ||
map("n", "<C-h>", "<cmd>NvimTreeFocus<CR>", { desc = "Nvimtree Focus window" }) | ||
map("n", "<C-n>", "<cmd>NvimTreeToggle<CR>", { desc = "NvimTreeToggle window" }) | ||
map("n", "<C-h>", "<cmd>NvimTreeFocus<CR>", { desc = "NvimTreeFocus window" }) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters