Compare commits
No commits in common. "411664497952b9017b4b53720f5f0cd8d31238da" and "14452344b4114fc837077814cacbc122cbc408be" have entirely different histories.
4116644979
...
14452344b4
14 changed files with 132 additions and 156 deletions
22
.gitmodules
vendored
22
.gitmodules
vendored
|
|
@ -1,13 +1,11 @@
|
|||
[submodule "pack/general/start/gruvbox.nvim"]
|
||||
path = pack/general/start/gruvbox.nvim
|
||||
url = https://github.com/npxbr/gruvbox.nvim
|
||||
branch = main
|
||||
[submodule "pack/general/start/lush.nvim"]
|
||||
path = pack/general/start/lush.nvim
|
||||
url = https://github.com/rktjmp/lush.nvim
|
||||
branch = main
|
||||
[submodule "pack/general/start/nvim-lspconfig"]
|
||||
path = pack/general/opt/nvim-lspconfig
|
||||
path = pack/general/start/nvim-lspconfig
|
||||
url = https://github.com/neovim/nvim-lspconfig
|
||||
branch = master
|
||||
[submodule "pack/general/start/nvim-treesitter"]
|
||||
|
|
@ -68,14 +66,12 @@
|
|||
[submodule "nvim-dap"]
|
||||
path = pack/general/opt/nvim-dap
|
||||
url = https://github.com/mfussenegger/nvim-dap
|
||||
branch = master
|
||||
[submodule "pack/general/start/nvim-dap-go"]
|
||||
path = pack/general/opt/nvim-dap-go
|
||||
url = https://github.com/leoluz/nvim-dap-go
|
||||
[submodule "pack/general/start/nvim-dap-ui"]
|
||||
path = pack/general/opt/nvim-dap-ui
|
||||
url = https://github.com/rcarriga/nvim-dap-ui
|
||||
branch = master
|
||||
[submodule "pack/general/start/vim-helm"]
|
||||
path = pack/general/start/vim-helm
|
||||
url = https://github.com/towolf/vim-helm
|
||||
|
|
@ -109,21 +105,26 @@
|
|||
[submodule "pack/general/start/crates.nvim"]
|
||||
path = pack/general/start/crates.nvim
|
||||
url = https://github.com/Saecki/crates.nvim
|
||||
branch = main
|
||||
[submodule "pack/general/start/neotest"]
|
||||
path = pack/general/opt/neotest
|
||||
path = pack/general/start/neotest
|
||||
url = https://github.com/nvim-neotest/neotest
|
||||
branch = master
|
||||
[submodule "pack/general/start/neotest-rust"]
|
||||
path = pack/general/opt/neotest-rust
|
||||
path = pack/general/start/neotest-rust
|
||||
url = https://github.com/rouge8/neotest-rust
|
||||
branch = main
|
||||
[submodule "pack/general/start/lsp_lines.nvim"]
|
||||
path = pack/general/opt/lsp_lines.nvim
|
||||
path = pack/general/start/lsp_lines.nvim
|
||||
url = https://git.sr.ht/~whynothugo/lsp_lines.nvim
|
||||
[submodule "pack/general/opt/crates.nvim"]
|
||||
path = pack/general/opt/crates.nvim
|
||||
url = https://github.com/Saecki/crates.nvim
|
||||
[submodule "pack/general/start/gruvbox"]
|
||||
branch = main
|
||||
[submodule "pack/general/opt/nvim-dap"]
|
||||
branch = master
|
||||
[submodule "pack/general/opt/nvim-dap-ui"]
|
||||
branch = master
|
||||
[submodule "pack/general/start/nvim-surround"]
|
||||
path = pack/general/start/nvim-surround
|
||||
url = https://github.com/kylechui/nvim-surround
|
||||
|
|
@ -132,6 +133,3 @@
|
|||
path = pack/general/start/nvim-spider
|
||||
url = https://github.com/chrisgrieser/nvim-spider
|
||||
branch = main
|
||||
[submodule "pack/general/opt/lsp_lines.nvim"]
|
||||
path = pack/general/opt/lsp_lines.nvim
|
||||
url = https://git.sr.ht/~whynothugo/lsp_lines.nvim
|
||||
|
|
|
|||
146
init.lua
146
init.lua
|
|
@ -1,41 +1,47 @@
|
|||
vim.loader.enable()
|
||||
---- Aliases ----
|
||||
local cmd = vim.cmd
|
||||
local g = vim.g
|
||||
local opt = vim.opt
|
||||
local opt_local = vim.opt_local
|
||||
|
||||
---- General Config ----
|
||||
vim.opt.mouse = "a"
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.number = true
|
||||
vim.opt.breakindent = true
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.joinspaces = false
|
||||
vim.opt.showmode = false
|
||||
vim.opt.hidden = true
|
||||
vim.opt.backup = false
|
||||
vim.opt.writebackup = false
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.shortmess:append({ I = true })
|
||||
opt.mouse = "a"
|
||||
opt.tabstop = 2
|
||||
opt.shiftwidth = 2
|
||||
opt.number = true
|
||||
opt.breakindent = true
|
||||
opt.showmatch = true
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.joinspaces = false
|
||||
opt.showmode = false
|
||||
opt.hidden = true
|
||||
opt.backup = false
|
||||
opt.writebackup = false
|
||||
opt.swapfile = false
|
||||
opt.shortmess:append({ I = true })
|
||||
-- whichwrap -- left/right keys can traverse up/down
|
||||
vim.opt.whichwrap:append("<,>,[,]")
|
||||
vim.opt.cmdheight = 2
|
||||
vim.opt.showcmd = true
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
vim.g.mapleader = " "
|
||||
opt.whichwrap:append("<,>,[,]")
|
||||
opt.cmdheight = 2
|
||||
opt.showcmd = true
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
g.mapleader = " "
|
||||
|
||||
---- Terminal ----
|
||||
vim.api.nvim_create_autocmd({ "TermOpen" }, {
|
||||
callback = function()
|
||||
vim.opt_local.number = false
|
||||
opt_local.number = false
|
||||
end,
|
||||
})
|
||||
|
||||
---- Theming ----
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.background = "dark"
|
||||
vim.g.gruvbox_italic = true
|
||||
vim.cmd.colorscheme("gruvbox")
|
||||
vim.opt.listchars = {
|
||||
opt.termguicolors = true
|
||||
opt.background = "dark"
|
||||
g.gruvbox_italic = true
|
||||
cmd.colorscheme("gruvbox")
|
||||
opt.listchars = {
|
||||
eol = "↲",
|
||||
tab = "▶▹",
|
||||
nbsp = "␣",
|
||||
|
|
@ -182,17 +188,17 @@ vim.filetype.add({ extension = { kdl = "kdl" } })
|
|||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.textwidth = 85
|
||||
vim.opt_local.spell = true
|
||||
opt_local.textwidth = 85
|
||||
opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
-- YAML --
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = "yaml",
|
||||
callback = function()
|
||||
vim.opt_local.softtabstop = 2
|
||||
vim.opt_local.expandtab = true
|
||||
vim.opt_local.foldmethod = "indent"
|
||||
opt_local.softtabstop = 2
|
||||
opt_local.expandtab = true
|
||||
opt_local.foldmethod = "indent"
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
@ -265,37 +271,11 @@ cmp.setup({
|
|||
}),
|
||||
})
|
||||
---- LSP ----
|
||||
vim.g.lsp_loaded = false
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = {
|
||||
"c",
|
||||
"cpp",
|
||||
"dot",
|
||||
"go",
|
||||
"javascript",
|
||||
"json",
|
||||
"latex",
|
||||
"lua",
|
||||
"markdown",
|
||||
"python",
|
||||
"rust",
|
||||
"terraform",
|
||||
"tex",
|
||||
"toml",
|
||||
"typescript",
|
||||
},
|
||||
callback = function()
|
||||
if vim.g.lsp_loaded == true then
|
||||
return
|
||||
end
|
||||
vim.g.lsp_loaded = true
|
||||
vim.cmd("packadd nvim-lspconfig")
|
||||
vim.cmd("packadd lsp_lines.nvim")
|
||||
local lsp = require("lspconfig")
|
||||
|
||||
local lsp = require("lspconfig")
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_lsp_attach = function(_client, _bufnr)
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_lsp_attach = function(_client, _bufnr)
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover)
|
||||
|
|
@ -312,11 +292,11 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
|||
vim.keymap.set("n", "<F3>", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local servers = {
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local servers = {
|
||||
clangd = {},
|
||||
dotls = {},
|
||||
eslint = {},
|
||||
|
|
@ -346,11 +326,11 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
|||
texlab = {},
|
||||
tflint = {},
|
||||
tsserver = {},
|
||||
}
|
||||
}
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
lsp.util.default_config = vim.tbl_deep_extend("force", lsp.util.default_config, { capabilities = capabilities })
|
||||
for server, add_to_config in pairs(servers) do
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
lsp.util.default_config = vim.tbl_deep_extend("force", lsp.util.default_config, { capabilities = capabilities })
|
||||
for server, add_to_config in pairs(servers) do
|
||||
local config = {
|
||||
on_attach = on_lsp_attach,
|
||||
flags = {
|
||||
|
|
@ -361,16 +341,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
|||
config[k] = v
|
||||
end
|
||||
lsp[server].setup(config)
|
||||
end
|
||||
|
||||
---- lsp_lines
|
||||
require("lsp_lines").setup()
|
||||
-- Disable virtual_text since it's redundant due to lsp_lines.
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
-- Auto format on save
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
|
|
@ -385,7 +356,7 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
|||
if lsp_format then
|
||||
vim.lsp.buf.format({ async = false })
|
||||
else
|
||||
vim.cmd("Format")
|
||||
cmd("Format")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
@ -514,9 +485,9 @@ require("gitsigns").setup({
|
|||
---- Comment.nvim
|
||||
require("Comment").setup()
|
||||
---- vim-markdown
|
||||
vim.g.vim_markdown_no_default_key_mappings = 1
|
||||
vim.g.vim_markdown_folding_disabled = 1
|
||||
vim.g.vim_markdown_toml_frontmatter = 1
|
||||
g.vim_markdown_no_default_key_mappings = 1
|
||||
g.vim_markdown_folding_disabled = 1
|
||||
g.vim_markdown_toml_frontmatter = 1
|
||||
---- Telescope
|
||||
local telescope = require("telescope")
|
||||
telescope.setup({
|
||||
|
|
@ -632,6 +603,13 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
|||
end
|
||||
})
|
||||
|
||||
---- lsp_lines
|
||||
require("lsp_lines").setup()
|
||||
-- Disable virtual_text since it's redundant due to lsp_lines.
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
||||
---- nvim-surround
|
||||
require("nvim-surround").setup()
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 04a06cee3fb9c584de4f5481eb4080bd6c759336
|
||||
Subproject commit db629b5cfb2aa8de9e44efb795657297ee95ca91
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 1fd22fa96c11573248f9fdd09f25e724c7bb3dd4
|
||||
Subproject commit c5fb16a934892086d4ba01bac48b77c65435025e
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit bdeba1cec3faddd89146690c10b9a87949c0ee66
|
||||
Subproject commit f0e9f5dd3218774fa725e55965b40ca78c2104eb
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 08a551cc8140e6ca41b5de6cabf75d02a246c330
|
||||
Subproject commit fc2b7df3d8384e1ba32d0c5d515931f5ea366eb1
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 966aad1accd47fa11fbe2539234f81f678fef2de
|
||||
Subproject commit a8f0f7b9f837887f13a61d67b40ae26188fe4d62
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 0960322686bfa38afd4f1e0b9660473cf77e24b6
|
||||
Subproject commit fc93fa5c07df7cd578a3ea82d7c075c0460a6884
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 45d0237c427baba8cd05e0ab26d30e2ee58c2c82
|
||||
Subproject commit 973ab742f143a796a779af4d786ec409116a0d87
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit ed9574dd6dde143d009b2528ea6d79bd34bbe6c8
|
||||
Subproject commit 40c8d2fc2b729dd442eda093cf8c9496d6e23732
|
||||
Loading…
Add table
Reference in a new issue