nvim: config diet

This commit is contained in:
2023-07-08 15:20:42 +03:00
parent a7fc52db2f
commit b58a85a0d6
8 changed files with 21 additions and 220 deletions

View File

@ -1 +1,2 @@
vim.cmd("colorscheme wal")
-- vim.cmd("colorscheme monokai")

View File

@ -43,7 +43,8 @@ vim.keymap.set("n", "<leader>F", "<cmd>Telescope find_files<CR>")
-- toggle term
vim.keymap.set("n", "<leader>c", "<cmd>ToggleTermToggleAll<CR>")
vim.keymap.set("n", "<leader>C", "<cmd>ToggleTerm<CR>")
-- vim.keymap.set("n", "<leader>C", "<cmd>ToggleTerm<CR>")
vim.keymap.set("n", "<leader>C", ":ToggleTerm<CR>")
-- frequent actions
vim.keymap.set("n", "<leader>ar", "<cmd>source ~/.config/nvim/init.lua<CR>")

View File

@ -87,14 +87,6 @@ require("packer").startup(function()
end,
})
use({
"sakhnik/nvim-gdb",
event = "BufEnter",
config = function()
require("plugins.gdb")
end,
})
-- comment.nvim
use({
"numToStr/Comment.nvim",
@ -149,7 +141,11 @@ require("packer").startup(function()
--
use({
-- 'crusoexia/vim-monokai',
"crusoexia/vim-monokai",
after = "nvim-treesitter",
})
use({
"dylanaraps/wal.vim",
after = "nvim-treesitter",
})
@ -158,61 +154,15 @@ require("packer").startup(function()
-- qol
--
-- blankline
use({
"lukas-reineke/indent-blankline.nvim",
event = "VimEnter",
})
-- highlight yank
use({
"machakann/vim-highlightedyank",
event = "TextYankPost",
})
-- tabular
use({
"godlygeek/tabular",
cmd = "Tabularize",
})
-- maximizer
use({
"szw/vim-maximizer",
cmd = "MaximizerToggle",
})
-- whichkey
use({
"folke/which-key.nvim",
config = function()
require("plugins.whichkey")
end,
})
--
-- filetype specific
-- org mode
--
-- csv
use({
"chrisbra/csv.vim",
ft = "csv",
})
-- latex
use({
"lervag/vimtex",
ft = "tex",
config = function()
require("plugins.vimtex")
end,
})
--
-- orgmode
--
use({
"nvim-orgmode/orgmode",
after = "nvim-treesitter",

View File

@ -1,35 +0,0 @@
-- settings
vim.g.nvimgdb_use_find_executables = 0
vim.g.nvimgdb_use_cmake_to_find_executables = 0
vim.g.nvimgdb_disable_start_keymaps = 1
-- filetype mappings
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = "python",
callback = function()
vim.keymap.set("n", "<leader>dd", ":GdbStartPDB python -m pdb ")
end,
})
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = "rust",
callback = function()
vim.keymap.set("n", "<leader>dd", ":GdbStart rust-gdb target/debug/")
end,
})
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "go", "c" },
callback = function()
vim.keymap.set("n", "<leader>dd", ":GdbStart gdb -q ")
end,
})
-- other mappings
vim.keymap.set("n", "<leader>db", "<cmd>GdbBreakpointToggle<CR>")
vim.keymap.set("n", "<leader>dc", "<cmd>GdbContinue<CR>")
vim.keymap.set("n", "<leader>du", "<cmd>GdbUntil<CR>")
vim.keymap.set("n", "<leader>ds", "<cmd>GdbStep<CR>")
vim.keymap.set("n", "<leader>dn", "<cmd>GdbNext<CR>")
vim.keymap.set("n", "<leader>do", "<cmd>GdbFinish<CR>")
vim.keymap.set("n", "<leader>dw", ":GdbCreateWatch ")

View File

@ -1,5 +1,5 @@
require("lint").linters_by_ft = {
-- python = { "mypy" },
python = { "mypy" },
}
vim.cmd("au BufWrite <buffer> lua require('lint').try_lint()")

View File

@ -1,42 +1,14 @@
local lsp = require("lspconfig")
-- language servers
lsp.pyright.setup({
settings = {
python = {
analysis = {
typeCheckingMode = "off",
diagnosticMode = "workspace",
},
},
},
})
-- lsp.pylsp.setup({})
lsp.gopls.setup({})
lsp.clangd.setup({})
lsp.texlab.setup({})
lsp.tsserver.setup({})
lsp.svelte.setup({})
lsp.rust_analyzer.setup({})
lsp.sumneko_lua.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
})
-- lsp.pyright.setup({
-- settings = {
-- python = {
-- analysis = {
-- typeCheckingMode = "off",
-- diagnosticMode = "workspace",
-- },
-- },
-- },
-- })
require("lspconfig").jedi_language_server.setup({})

View File

@ -1,7 +0,0 @@
-- ignore certain errors
-- vim.g.vimtex_quickfix_ignore_filters = { "Underfull", "Overfull", "babel" }
-- use zathura as the pdf viewer
vim.g.vimtex_view_general_viewer = "zathura"
vim.g.vimtex_compiler_latexmk_engines = { _ = "-lualatex" }

View File

@ -1,81 +0,0 @@
local wk = require("which-key")
wk.register({
a = {
name = "Actions",
r = "Reload Config",
c = "Find Config Files",
},
d = {
name = "Debug",
b = "Toggle Breakpoint",
f = "Finish / Step Out",
n = "Next",
s = "Step Into",
u = "Until",
w = "Create Watch",
},
g = {
name = "Language",
D = "Go To Declaration",
a = "Code Actions",
d = "Go To Definition",
e = "Show Line Diagnostics",
f = "Format Code",
F = "Format Code And Write Changes",
i = "Show Implementations",
k = "Hover",
n = "Rename",
q = "Show Diagnostics",
r = "Show References",
s = "Restart LSP Server",
t = "Show Type Definition",
},
o = {
name = "Org",
a = "Agenda",
c = "Capture",
f = "Find Org Files",
},
s = {
name = "Splits & Buffers",
v = "Vertical Split",
z = "Horizontal Split Split",
t = "New Tab",
b = "Show Buffers",
h = "Left Tab",
l = "Right Tab",
},
t = {
name = "Telescope",
w = "Workspace Symbols",
d = "Document Symbols",
o = "Old Files",
g = "Grep",
s = "Treesitter",
},
v = {
name = "Version Control (git)",
A = "Add",
a = "Add Everything (add .)",
c = "Commit",
f = "Fetch",
g = "Git",
l = "Pull",
p = "Push",
s = "Status",
},
C = "Terminal",
F = "Fuzzy Files",
Q = "Quit All",
S = "Save All",
X = "Quit All Without Saving",
c = "Toggle All Terminal",
f = "File Manager",
h = "Left Split",
j = "Down Split",
k = "Up Split",
l = "Right Split",
q = "Quit",
x = "Quit Without Saving",
}, { prefix = "<leader>" })
wk.setup({})