add nvim config
This commit is contained in:
21
lazy-lock.json
Executable file
21
lazy-lock.json
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" },
|
||||||
|
"autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "18bab5ec4c782cdf7d7525dbe89c60bfa02fc195" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
|
"indent-blankline.nvim": { "branch": "master", "commit": "dddb5d21811c319eb6e51a993d8fb44b193aae3f" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
|
||||||
|
"lsp-zero.nvim": { "branch": "v3.x", "commit": "56db3d5ce5476b183783160e6045f7337ba12b83" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "f2acd4a21db1ca0a12559e7a9f7cdace3bdbfb09" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "ad32182cc4a03c8826a64e9ced68046c575fdb7d" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "ad0b95dee55955817af635fa121f6e2486b10583" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "3de418e73d5b912096229aaeea8bb7aef5094e0d" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
||||||
|
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }
|
||||||
|
}
|
||||||
60
lua/config/init.lua
Executable file
60
lua/config/init.lua
Executable file
@@ -0,0 +1,60 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
require("config.lazy")
|
||||||
|
require('lspconfig').gdscript.setup({})
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.laststatus = 3
|
||||||
|
vim.cmd.colorscheme "catppuccin-macchiato"
|
||||||
|
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.autoindent = true
|
||||||
|
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.opt.background = "dark"
|
||||||
|
vim.cmd "set noshowmode"
|
||||||
|
vim.cmd "set nowrap"
|
||||||
|
|
||||||
|
vim.opt.backspace = "indent,eol,start"
|
||||||
|
vim.opt.clipboard:append("unnamedplus")
|
||||||
|
vim.opt.splitright = true
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
-- vim.api.nvim_command('autocmd VimEnter * :set laststatus=3')
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>e", ":Tex<CR>")
|
||||||
|
|
||||||
|
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||||
|
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||||
|
|
||||||
|
local pipepath = vim.fn.stdpath("cache") .. "/server.pipe"
|
||||||
|
if not vim.loop.fs_stat(pipepath) then
|
||||||
|
vim.fn.serverstart(pipepath)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<Leader>t", ":split<CR>:term<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>f", ":Telescope find_files<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>e", ":NvimTreeToggle<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>n", ":tabnew<CR>:Telescope find_files<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>v", ":vsplit<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>h", ":split<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>m", ":Mason<CR>")
|
||||||
|
vim.keymap.set('t', "<C-q>", "<C-\\><C-n><C-w>h")
|
||||||
|
vim.keymap.set("n", "<Tab>", ":tabn<CR>")
|
||||||
|
vim.keymap.set("n", "<Tab>", ":tabp<CR>")
|
||||||
|
|
||||||
|
-- vim.keymap.set("", "j", "<Left>")
|
||||||
|
-- vim.keymap.set("", "k", "<Up>")
|
||||||
|
-- vim.keymap.set("", "l", "<Down>")
|
||||||
|
-- vim.keymap.set("", ";", "<Right>")
|
||||||
|
-- vim.keymap.set("n", "<C-j>", "<C-W>h")
|
||||||
|
-- vim.keymap.set("n", "<C-k>", "<C-W>k")
|
||||||
|
-- vim.keymap.set("n", "<C-l>", "<C-W>j")
|
||||||
|
-- vim.keymap.set("n", "<C-;>", "<C-W>l")
|
||||||
|
vim.keymap.set("n", "F", ":%s//<Left>")
|
||||||
|
vim.keymap.set("n", "f", ":%s//g<Left><Left>")
|
||||||
|
|
||||||
3
lua/config/lazy-lock.json
Executable file
3
lua/config/lazy-lock.json
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
14
lua/config/lazy.lua
Executable file
14
lua/config/lazy.lua
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup({spec = "config.plugins"})
|
||||||
7
lua/config/plugins/autoclose.lua
Executable file
7
lua/config/plugins/autoclose.lua
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"m4xshen/autoclose.nvim",
|
||||||
|
lazy = false,
|
||||||
|
init = function ()
|
||||||
|
require("autoclose").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
7
lua/config/plugins/comment.lua
Executable file
7
lua/config/plugins/comment.lua
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"numtoStr/Comment.nvim",
|
||||||
|
lazy = false,
|
||||||
|
init = function ()
|
||||||
|
require('Comment').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
1
lua/config/plugins/indent-blankline.lua
Executable file
1
lua/config/plugins/indent-blankline.lua
Executable file
@@ -0,0 +1 @@
|
|||||||
|
return { "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} }
|
||||||
95
lua/config/plugins/lsp.lua
Executable file
95
lua/config/plugins/lsp.lua
Executable file
@@ -0,0 +1,95 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'VonHeikemen/lsp-zero.nvim',
|
||||||
|
branch = 'v3.x',
|
||||||
|
lazy = true,
|
||||||
|
config = false,
|
||||||
|
init = function()
|
||||||
|
-- Disable automatic setup, we are doing it manually
|
||||||
|
vim.g.lsp_zero_extend_cmp = 0
|
||||||
|
vim.g.lsp_zero_extend_lspconfig = 0
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
lazy = false,
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Autocompletion
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
event = 'InsertEnter',
|
||||||
|
dependencies = {
|
||||||
|
{'L3MON4D3/LuaSnip'},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- Here is where you configure the autocompletion settings.
|
||||||
|
local lsp_zero = require('lsp-zero')
|
||||||
|
lsp_zero.extend_cmp()
|
||||||
|
|
||||||
|
-- And you can configure cmp even more, if you want to.
|
||||||
|
local cmp = require('cmp')
|
||||||
|
local cmp_action = lsp_zero.cmp_action()
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
formatting = lsp_zero.cmp_format({details = true}),
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<Enter>'] = cmp.mapping.confirm({select = false}),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-f>'] = cmp_action.luasnip_jump_forward(),
|
||||||
|
['<C-b>'] = cmp_action.luasnip_jump_backward(),
|
||||||
|
}),
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
{
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
cmd = {'LspInfo', 'LspInstall', 'LspStart'},
|
||||||
|
event = {'BufReadPre', 'BufNewFile'},
|
||||||
|
dependencies = {
|
||||||
|
{'hrsh7th/cmp-nvim-lsp'},
|
||||||
|
{'williamboman/mason-lspconfig.nvim'},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- This is where all the LSP shenanigans will live
|
||||||
|
local lsp_zero = require('lsp-zero')
|
||||||
|
lsp_zero.extend_lspconfig()
|
||||||
|
|
||||||
|
--- if you want to know more about lsp-zero and mason.nvim
|
||||||
|
--- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guides/integrate-with-mason-nvim.md
|
||||||
|
lsp_zero.on_attach(function(client, bufnr)
|
||||||
|
-- see :help lsp-zero-keybindings
|
||||||
|
-- to learn the available actions
|
||||||
|
lsp_zero.default_keymaps({buffer = bufnr})
|
||||||
|
end)
|
||||||
|
|
||||||
|
require('mason-lspconfig').setup({
|
||||||
|
ensure_installed = {'rust_analyzer', 'lua_ls'},
|
||||||
|
handlers = {
|
||||||
|
-- this first function is the "default handler"
|
||||||
|
-- it applies to every language server without a "custom handler"
|
||||||
|
function(server_name)
|
||||||
|
require('lspconfig')[server_name].setup({})
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- this is the "custom handler" for `lua_ls`
|
||||||
|
lua_ls = function()
|
||||||
|
-- (Optional) Configure lua language server for neovim
|
||||||
|
local lua_opts = lsp_zero.nvim_lua_ls()
|
||||||
|
require('lspconfig').lua_ls.setup(lua_opts)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
29
lua/config/plugins/telescope.lua
Executable file
29
lua/config/plugins/telescope.lua
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
|
||||||
|
tag = "0.1.5",
|
||||||
|
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim"
|
||||||
|
},
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
require('telescope').setup({})
|
||||||
|
|
||||||
|
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>pws', function()
|
||||||
|
local word = vim.fn.expand("<cword>")
|
||||||
|
builtin.grep_string({ search = word })
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>pWs', function()
|
||||||
|
local word = vim.fn.expand("<cWORD>")
|
||||||
|
builtin.grep_string({ search = word })
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>ps', function()
|
||||||
|
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
|
||||||
|
end
|
||||||
|
}
|
||||||
1
lua/config/plugins/theme.lua
Executable file
1
lua/config/plugins/theme.lua
Executable file
@@ -0,0 +1 @@
|
|||||||
|
return { "catppuccin/nvim", name = "catppuccin", priority = 1000 }
|
||||||
11
lua/config/plugins/tree.lua
Executable file
11
lua/config/plugins/tree.lua
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
version = "*",
|
||||||
|
lazy = false,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("nvim-tree").setup {}
|
||||||
|
end,
|
||||||
|
}
|
||||||
46
lua/config/plugins/treesitter.lua
Executable file
46
lua/config/plugins/treesitter.lua
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
config = function()
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
-- A list of parser names, or "all"
|
||||||
|
ensure_installed = {
|
||||||
|
"vimdoc", "javascript", "typescript", "c", "lua", "rust",
|
||||||
|
"jsdoc", "bash",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- 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,
|
||||||
|
|
||||||
|
indent = {
|
||||||
|
enable = 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 = { "markdown" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
treesitter_parser_config.templ = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/vrischmann/tree-sitter-templ.git",
|
||||||
|
files = {"src/parser.c", "src/scanner.c"},
|
||||||
|
branch = "master",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.treesitter.language.register("templ", "templ")
|
||||||
|
end
|
||||||
|
}
|
||||||
7
lua/config/plugins/undotree.lua
Executable file
7
lua/config/plugins/undotree.lua
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"mbbill/undotree",
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||||
|
end
|
||||||
|
}
|
||||||
13
lua/config/plugins/whichkey.lua
Executable file
13
lua/config/plugins/whichkey.lua
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
init = function()
|
||||||
|
vim.o.timeout = true
|
||||||
|
vim.o.timeoutlen = 300
|
||||||
|
end,
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user