init
This commit is contained in:
8
after/plugin/colors.lua
Normal file
8
after/plugin/colors.lua
Normal file
@ -0,0 +1,8 @@
|
||||
function Color(color)
|
||||
color = color or "rose-pine"
|
||||
vim.cmd.colorscheme(color)
|
||||
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
end
|
||||
|
||||
Color()
|
7
after/plugin/dap.lua
Normal file
7
after/plugin/dap.lua
Normal file
@ -0,0 +1,7 @@
|
||||
local dap = require('dap')
|
||||
|
||||
dap.adapters.godot = {
|
||||
type = "server",
|
||||
host = "127.0.0.1",
|
||||
port = 6006,
|
||||
}
|
1
after/plugin/fugitive.lua
Normal file
1
after/plugin/fugitive.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
5
after/plugin/harpoon.lua
Normal file
5
after/plugin/harpoon.lua
Normal file
@ -0,0 +1,5 @@
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
|
||||
vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
49
after/plugin/lsp.lua
Normal file
49
after/plugin/lsp.lua
Normal file
@ -0,0 +1,49 @@
|
||||
local lsp = require("lsp-zero")
|
||||
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-j>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({select = true}),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{name = 'path'},
|
||||
{name = 'nvim_lsp'},
|
||||
{name = 'nvim_lua'},
|
||||
},
|
||||
formatting = lsp.cmp_format(),
|
||||
mapping = cmp.mapping.preset.insert(cmp_mappings)
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("n", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
|
||||
end)
|
||||
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {'tsserver', 'eslint', 'rust_analyzer', 'gopls'},
|
||||
handlers = {
|
||||
lsp.default_setup,
|
||||
lua_ls = function()
|
||||
local lua_opts = lsp.nvim_lua_ls()
|
||||
require('lspconfig').lua_ls.setup(lua_opts)
|
||||
end,
|
||||
}
|
||||
})
|
8
after/plugin/telescope.lua
Normal file
8
after/plugin/telescope.lua
Normal file
@ -0,0 +1,8 @@
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>pb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>ph', builtin.help_tags, {})
|
||||
vim.keymap.set('n', '<leader>ps', function()
|
||||
builtin.grep_string({search = vim.fn.input("Grep > ") })
|
||||
end)
|
30
after/plugin/treesitter.lua
Normal file
30
after/plugin/treesitter.lua
Normal file
@ -0,0 +1,30 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query", "rust", "go" },
|
||||
|
||||
-- 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,
|
||||
|
||||
|
||||
---- 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
|
||||
|
||||
-- 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,
|
||||
},
|
||||
}
|
1
after/plugin/undotree.lua
Normal file
1
after/plugin/undotree.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
Reference in New Issue
Block a user