💥 Reformatted neovim config
This commit is contained in:
parent
663a357e44
commit
ab7b3a65ed
13 changed files with 453 additions and 0 deletions
9
the_primeagen_nvim_setup/after/plugin/colors.lua
Normal file
9
the_primeagen_nvim_setup/after/plugin/colors.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
function ColorMyPencils(color)
|
||||
color = color or "nord"
|
||||
vim.cmd.colorscheme(color)
|
||||
|
||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
end
|
||||
|
||||
ColorMyPencils()
|
||||
1
the_primeagen_nvim_setup/after/plugin/fugitive.lua
Normal file
1
the_primeagen_nvim_setup/after/plugin/fugitive.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||
10
the_primeagen_nvim_setup/after/plugin/harpoon.lua
Normal file
10
the_primeagen_nvim_setup/after/plugin/harpoon.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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)
|
||||
|
||||
vim.keymap.set("n", "<S-j>", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<S-k>", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<S-h>", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<S-l>", function() ui.nav_file(4) end)
|
||||
76
the_primeagen_nvim_setup/after/plugin/lsp.lua
Normal file
76
the_primeagen_nvim_setup/after/plugin/lsp.lua
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
local lsp = require("lsp-zero")
|
||||
|
||||
lsp.preset("recommended")
|
||||
|
||||
lsp.ensure_installed({
|
||||
'tsserver',
|
||||
'eslint',
|
||||
'sumneko_lua',
|
||||
'rust_analyzer',
|
||||
})
|
||||
|
||||
-- Fix Undefined global 'vim'
|
||||
lsp.configure('sumneko_lua', {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' }
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
-- disable completion with tab
|
||||
-- this helps with copilot setup
|
||||
cmp_mappings['<Tab>'] = nil
|
||||
cmp_mappings['<S-Tab>'] = nil
|
||||
|
||||
lsp.setup_nvim_cmp({
|
||||
mapping = cmp_mappings
|
||||
})
|
||||
|
||||
lsp.set_preferences({
|
||||
suggest_lsp_servers = false,
|
||||
sign_icons = {
|
||||
error = 'E',
|
||||
warn = 'W',
|
||||
hint = 'H',
|
||||
info = 'I'
|
||||
}
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
|
||||
if client.name == "eslint" then
|
||||
vim.cmd.LspStop('eslint')
|
||||
return
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "<leader>vws", vim.lsp.buf.workspace_symbol, opts)
|
||||
vim.keymap.set("n", "<leader>vd", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "<leader>vca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
end)
|
||||
|
||||
lsp.setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
})
|
||||
6
the_primeagen_nvim_setup/after/plugin/telescope.lua
Normal file
6
the_primeagen_nvim_setup/after/plugin/telescope.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
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>ps', function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
||||
end)
|
||||
22
the_primeagen_nvim_setup/after/plugin/treesitter.lua
Normal file
22
the_primeagen_nvim_setup/after/plugin/treesitter.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = { "help", "python", "markdown", "html", "css", "javascript", "typescript", "c", "lua", "rust" },
|
||||
|
||||
-- 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 = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
||||
-- 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
the_primeagen_nvim_setup/after/plugin/undotree.lua
Normal file
1
the_primeagen_nvim_setup/after/plugin/undotree.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
Loading…
Add table
Add a link
Reference in a new issue