nvim configs updated
- toggle term added - langmap added - norg and markdown files wordwrap and linebreak - clipboard image plugin added - dap go added - dressing plugin added - easytables plugin - image viewer plugin added - kanagawa theme added, but disabled - ltex (checks writing correctness) plugin added - markdown preview plugin added - markview plugin added - lsp signature plugin added - neorg plugin added - otter plugin added - pastify plugin added - project nvim plugin added
This commit is contained in:
parent
10f3344df9
commit
161e082bf2
@ -4,8 +4,12 @@ vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
||||
-- ───────────────────────── Diagnostic keymaps ──────────────────────
|
||||
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
|
||||
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ terminal │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
-- ────────── easy leave terminal (shortcut to ctrl+\, ctrl+n) ───────
|
||||
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
||||
vim.keymap.set("n", "tt", ":ToggleTerm<CR>", { desc = "Toggle terminal" })
|
||||
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Windows │
|
||||
|
@ -106,3 +106,41 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Langmap │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
local function escape(str)
|
||||
-- Эти символы должны быть экранированы, если встречаются в langmap
|
||||
local escape_chars = [[;,."|\]]
|
||||
return vim.fn.escape(str, escape_chars)
|
||||
end
|
||||
|
||||
-- Наборы символов, введенных с зажатым шифтом
|
||||
local en_shift = [[~QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>]]
|
||||
local ru_shift = [[ËЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ]]
|
||||
-- Наборы символов, введенных как есть
|
||||
-- Здесь я не добавляю ',.' и 'бю', чтобы впоследствии не было рекурсивного вызова комманды
|
||||
local en = [[`qwertyuiop[]asdfghjkl;'zxcvbnm,.]]
|
||||
local ru = [[ёйцукенгшщзхъфывапролджэячсмитьбю]]
|
||||
vim.opt.langmap = vim.fn.join({
|
||||
-- ; - разделитель, который не нужно экранировать
|
||||
-- |
|
||||
escape(ru_shift)
|
||||
.. ";"
|
||||
.. escape(en_shift),
|
||||
escape(ru) .. ";" .. escape(en),
|
||||
}, ",")
|
||||
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ enable word wrap and linebreak for norg and markdown │
|
||||
-- │ files │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "norg", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.linebreak = true
|
||||
end,
|
||||
})
|
||||
|
3
.config/nvim/lua/goodhumored/plugins/auto-pairs.lua
Normal file
3
.config/nvim/lua/goodhumored/plugins/auto-pairs.lua
Normal file
@ -0,0 +1,3 @@
|
||||
return {
|
||||
"jiangmiao/auto-pairs",
|
||||
}
|
@ -76,7 +76,7 @@ return { -- Autocompletion
|
||||
-- Manually trigger a completion from nvim-cmp.
|
||||
-- Generally you don't need this, because nvim-cmp will display
|
||||
-- completions whenever it has completion options available.
|
||||
["<C-k>"] = cmp.mapping.complete({}),
|
||||
["<C-;>"] = cmp.mapping.complete(),
|
||||
|
||||
-- Think of <c-l> as moving to the right of your snippet expansion.
|
||||
-- So if you have a snippet that's like:
|
||||
|
29
.config/nvim/lua/goodhumored/plugins/clipboard-image.lua
Normal file
29
.config/nvim/lua/goodhumored/plugins/clipboard-image.lua
Normal file
@ -0,0 +1,29 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ ekickx/clipboard-image.nvim │
|
||||
-- │ paste images into markdown │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
return {
|
||||
"postfen/clipboard-image.nvim",
|
||||
config = function()
|
||||
require("clipboard-image").setup({
|
||||
default = {
|
||||
img_name = function()
|
||||
vim.fn.inputsave()
|
||||
local name = vim.fn.input("Name: ")
|
||||
vim.fn.inputrestore()
|
||||
if name == nil or name == "" then
|
||||
name = os.date("%d-%m-%y-%H:%M:%S")
|
||||
end
|
||||
return name
|
||||
end,
|
||||
img_handler = function(img)
|
||||
vim.cmd("normal! f[") -- go to [
|
||||
vim.cmd("normal! a" .. img.name) -- append text with image name
|
||||
end,
|
||||
|
||||
img_dir = { "%:p:h", "img" },
|
||||
},
|
||||
})
|
||||
vim.keymap.set("n", "<leader>pi", "<cmd>PasteImg<CR>", { desc = "[P]aste [I]mage" })
|
||||
end,
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
return {
|
||||
"tpope/vim-sleuth", -- Detect tabstop and shiftwidth automatically
|
||||
"jiangmiao/auto-pairs",
|
||||
}
|
||||
|
58
.config/nvim/lua/goodhumored/plugins/dap/dap-go.lua
Normal file
58
.config/nvim/lua/goodhumored/plugins/dap/dap-go.lua
Normal file
@ -0,0 +1,58 @@
|
||||
return {
|
||||
"leoluz/nvim-dap-go",
|
||||
config = function()
|
||||
require("dap-go").setup({
|
||||
-- Additional dap configurations can be added.
|
||||
-- dap_configurations accepts a list of tables where each entry
|
||||
-- represents a dap configuration. For more details do:
|
||||
-- :help dap-configuration
|
||||
dap_configurations = {
|
||||
{
|
||||
-- Must be "go" or it will be ignored by the plugin
|
||||
type = "go",
|
||||
name = "Attach remote",
|
||||
mode = "remote",
|
||||
request = "attach",
|
||||
},
|
||||
},
|
||||
-- delve configurations
|
||||
delve = {
|
||||
-- the path to the executable dlv which will be used for debugging.
|
||||
-- by default, this is the "dlv" executable on your PATH.
|
||||
path = "dlv",
|
||||
-- time to wait for delve to initialize the debug session.
|
||||
-- default to 20 seconds
|
||||
initialize_timeout_sec = 20,
|
||||
-- a string that defines the port to start delve debugger.
|
||||
-- default to string "${port}" which instructs nvim-dap
|
||||
-- to start the process in a random available port.
|
||||
-- if you set a port in your debug configuration, its value will be
|
||||
-- assigned dynamically.
|
||||
port = "${port}",
|
||||
-- additional args to pass to dlv
|
||||
args = {},
|
||||
-- the build flags that are passed to delve.
|
||||
-- defaults to empty string, but can be used to provide flags
|
||||
-- such as "-tags=unit" to make sure the test suite is
|
||||
-- compiled during debugging, for example.
|
||||
-- passing build flags using args is ineffective, as those are
|
||||
-- ignored by delve in dap mode.
|
||||
-- avaliable ui interactive function to prompt for arguments get_arguments
|
||||
build_flags = {},
|
||||
-- whether the dlv process to be created detached or not. there is
|
||||
-- an issue on Windows where this needs to be set to false
|
||||
-- otherwise the dlv server creation will fail.
|
||||
-- avaliable ui interactive function to prompt for build flags: get_build_flags
|
||||
detached = vim.fn.has("win32") == 0,
|
||||
-- the current working directory to run dlv from, if other than
|
||||
-- the current working directory.
|
||||
cwd = nil,
|
||||
},
|
||||
-- options related to running closest test
|
||||
tests = {
|
||||
-- enables verbosity when running the test.
|
||||
verbose = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
@ -78,6 +78,16 @@ return {
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}",
|
||||
},
|
||||
}
|
||||
|
||||
-- setup dap config by VsCode launch.json file
|
||||
local vscode = require("dap.ext.vscode")
|
||||
local json = require("plenary.json")
|
||||
@ -90,6 +100,7 @@ return {
|
||||
vscode.load_launchjs()
|
||||
end
|
||||
end,
|
||||
|
||||
keys = {
|
||||
{ "<leader>d", "", desc = "+debug", mode = { "n", "v" } },
|
||||
{
|
||||
|
8
.config/nvim/lua/goodhumored/plugins/dressing.lua
Normal file
8
.config/nvim/lua/goodhumored/plugins/dressing.lua
Normal file
@ -0,0 +1,8 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ stevearc/dressing.nvim │
|
||||
-- │ beautiful inputs │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
opts = {},
|
||||
}
|
27
.config/nvim/lua/goodhumored/plugins/easytables.lua
Normal file
27
.config/nvim/lua/goodhumored/plugins/easytables.lua
Normal file
@ -0,0 +1,27 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Myzel394/easytables.nvim │
|
||||
-- │ plugin for easy work with markdown tables │
|
||||
-- │ https://github.com/Myzel394/easytables.nvim │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
-- #### Inserting a new table
|
||||
--
|
||||
-- Go to the place where you want to insert your table and either call:
|
||||
--
|
||||
-- * `:EasyTablesCreateNew <width>x<height>` - Creates a new table with `<width>` columns and `<height>` rows
|
||||
-- * `:EasyTablesCreateNew <width>` - Creates a square table with the size of `<width>` (eg. `:EasyTablesCreateNew 5` -> Creates a `5x5` table)
|
||||
-- * `:EasyTablesCreateNew <width>x` - Creates a table with `<width>` columns and **one** row
|
||||
-- * `:EasyTablesCreateNew x<height>` - Creates a table with **one** column and `<height>` rows
|
||||
--
|
||||
-- #### Editing an existing table
|
||||
--
|
||||
-- Go to your table (doesn't matter where, can be at a border or inside a cell) and type:
|
||||
--
|
||||
-- `:EasyTablesImportThisTable`
|
||||
return {
|
||||
"Myzel394/easytables.nvim",
|
||||
config = function()
|
||||
require("easytables").setup({
|
||||
-- Your configuration comes here
|
||||
})
|
||||
end,
|
||||
}
|
52
.config/nvim/lua/goodhumored/plugins/image.lua.disable
Normal file
52
.config/nvim/lua/goodhumored/plugins/image.lua.disable
Normal file
@ -0,0 +1,52 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ 3rd/image.nvim │
|
||||
-- │ images view inside vim │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
return {
|
||||
"3rd/image.nvim",
|
||||
config = function()
|
||||
local image = require("image")
|
||||
-- default config
|
||||
image.setup({
|
||||
backend = "kitty",
|
||||
integrations = {
|
||||
markdown = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
|
||||
},
|
||||
neorg = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "norg" },
|
||||
},
|
||||
html = {
|
||||
enabled = false,
|
||||
},
|
||||
css = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
max_width = nil,
|
||||
max_height = nil,
|
||||
max_width_window_percentage = nil,
|
||||
max_height_window_percentage = 50,
|
||||
window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
|
||||
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
|
||||
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus
|
||||
tmux_show_only_in_active_window = true, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
|
||||
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
|
||||
})
|
||||
vim.keymap.set("n", "<leader>ti", function()
|
||||
if image.is_enabled() then
|
||||
image.disable()
|
||||
else
|
||||
image.enable()
|
||||
end
|
||||
end, {})
|
||||
end,
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
return {
|
||||
"rebelot/kanagawa.nvim",
|
||||
}
|
@ -203,7 +203,26 @@ return { -- LSP Configuration & Plugins
|
||||
-- ol gur freire pbasvthengvba nobir. Hfrshy jura qvfnoyvat
|
||||
-- pregnva srngherf bs na YFC (sbe rknzcyr, gheavat bss sbeznggvat sbe gffreire)
|
||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
local lspConfig = require("lspconfig")
|
||||
lspConfig[server_name].setup(server)
|
||||
lspConfig.gopls.setup({
|
||||
settings = {
|
||||
gopls = {
|
||||
gofumpt = true,
|
||||
golines = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
-- https://microsoft.github.io/pyright/#/settings
|
||||
lspConfig.pyright.setup({
|
||||
capabilities = capabilities,
|
||||
python = {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
diagnosticMode = "workspace",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
45
.config/nvim/lua/goodhumored/plugins/ltex.lua
Normal file
45
.config/nvim/lua/goodhumored/plugins/ltex.lua
Normal file
@ -0,0 +1,45 @@
|
||||
return {
|
||||
"vigoux/ltex-ls.nvim",
|
||||
-- config = function()
|
||||
-- require("ltex-ls").setup({
|
||||
-- use_spellfile = false,
|
||||
-- filetypes = { "latex", "tex", "bib", "markdown", "gitcommit", "text" },
|
||||
-- settings = {
|
||||
-- ltex = {
|
||||
-- enabled = { "latex", "tex", "bib", "markdown" },
|
||||
-- language = "auto",
|
||||
-- diagnosticSeverity = "information",
|
||||
-- sentenceCacheSize = 2000,
|
||||
-- additionalRules = {
|
||||
-- enablePickyRules = true,
|
||||
-- motherTongue = "ru",
|
||||
-- },
|
||||
-- disabledRules = {},
|
||||
-- dictionary = (function()
|
||||
-- -- For dictionary, search for files in the runtime to have
|
||||
-- -- and include them as externals the format for them is
|
||||
-- -- dict/{LANG}.txt
|
||||
-- --
|
||||
-- -- Also add dict/default.txt to all of them
|
||||
-- local files = {}
|
||||
-- for _, file in ipairs(vim.api.nvim_get_runtime_file("dict/*", true)) do
|
||||
-- local lang = vim.fn.fnamemodify(file, ":t:r")
|
||||
-- local fullpath = vim.fs.normalize(file, ":p")
|
||||
-- files[lang] = { ":" .. fullpath }
|
||||
-- end
|
||||
--
|
||||
-- if files.default then
|
||||
-- for lang, _ in pairs(files) do
|
||||
-- if lang ~= "default" then
|
||||
-- vim.list_extend(files[lang], files.default)
|
||||
-- end
|
||||
-- end
|
||||
-- files.default = nil
|
||||
-- end
|
||||
-- return files
|
||||
-- end)(),
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
}
|
12
.config/nvim/lua/goodhumored/plugins/markdown-preview.lua
Normal file
12
.config/nvim/lua/goodhumored/plugins/markdown-preview.lua
Normal file
@ -0,0 +1,12 @@
|
||||
-- install with yarn or npm
|
||||
return
|
||||
-- install with yarn or npm
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
}
|
17
.config/nvim/lua/goodhumored/plugins/markview.lua
Normal file
17
.config/nvim/lua/goodhumored/plugins/markview.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ markview │
|
||||
-- │ markdown beautifier │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
return {
|
||||
"OXY2DEV/markview.nvim",
|
||||
lazy = false, -- Recommended
|
||||
-- ft = "markdown" -- If you decide to lazy-load anyway
|
||||
|
||||
dependencies = {
|
||||
-- You will not need this if you installed the
|
||||
-- parsers manually
|
||||
-- Or if the parsers are in your $RUNTIMEPATH
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ ray-x/lsp_signature.nvim │
|
||||
-- │ shows method signature in insert mode │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
return {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require("lsp_signature").setup(opts)
|
||||
end,
|
||||
}
|
50
.config/nvim/lua/goodhumored/plugins/neorg.lua
Normal file
50
.config/nvim/lua/goodhumored/plugins/neorg.lua
Normal file
@ -0,0 +1,50 @@
|
||||
return {
|
||||
"nvim-neorg/neorg",
|
||||
lazy = false,
|
||||
version = "*",
|
||||
config = function()
|
||||
require("neorg").setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.concealer"] = {},
|
||||
["core.dirman"] = {
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = "~/notes",
|
||||
uni = "~/Uni",
|
||||
job = "~/job",
|
||||
side = "~/side-hustle",
|
||||
},
|
||||
default_workspace = "notes",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.wo.foldlevel = 99
|
||||
vim.wo.conceallevel = 2
|
||||
end,
|
||||
|
||||
keys = {
|
||||
{
|
||||
"<leader>n",
|
||||
":Neorg<CR>",
|
||||
desc = "[N]eorg",
|
||||
},
|
||||
{
|
||||
"<leader>nw",
|
||||
":Neorg workspace<CR>",
|
||||
desc = "[N]eorg [W]orkspaces",
|
||||
},
|
||||
{
|
||||
"<leader>nj",
|
||||
":Neorg journal<CR>",
|
||||
desc = "[N]eorg [J]ournal",
|
||||
},
|
||||
{
|
||||
"<leader>ni",
|
||||
":Neorg index<CR>",
|
||||
desc = "[N]eorg [I]ndex",
|
||||
},
|
||||
},
|
||||
}
|
14
.config/nvim/lua/goodhumored/plugins/otter.lua
Normal file
14
.config/nvim/lua/goodhumored/plugins/otter.lua
Normal file
@ -0,0 +1,14 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ jmbuhr/otter.nvim │
|
||||
-- │ adds completions, treesitter and lsp featurs to │
|
||||
-- │ markdown codeblocks │
|
||||
-- │ https://github.com/jmbuhr/otter.nvim │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
return {
|
||||
"jmbuhr/otter.nvim",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
opts = {},
|
||||
}
|
15
.config/nvim/lua/goodhumored/plugins/pastify.lua.disable
Normal file
15
.config/nvim/lua/goodhumored/plugins/pastify.lua.disable
Normal file
@ -0,0 +1,15 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ pastify │
|
||||
-- │ enables pasting image from clipboard │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
return {
|
||||
"TobinPalmer/pastify.nvim",
|
||||
cmd = { "Pastify", "PastifyAfter" },
|
||||
config = function()
|
||||
require("pastify").setup({
|
||||
-- opts = {
|
||||
-- apikey = "YOUR API KEY (https://api.imgbb.com/)", -- Needed if you want to save online.
|
||||
-- },
|
||||
})
|
||||
end,
|
||||
}
|
@ -20,9 +20,9 @@ return {
|
||||
silent_chdir = true,
|
||||
})
|
||||
require("telescope").load_extension("projects")
|
||||
vim.keymap.set({ "n" }, "<leader>pf", function()
|
||||
vim.keymap.set({ "n" }, "<leader>sp", function()
|
||||
require("telescope").extensions.projects.projects({})
|
||||
end, { desc = "[P]rojects [F]ind" })
|
||||
end, { desc = "[S]earch [P]roject" })
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
|
1
.config/nvim/lua/goodhumored/plugins/toggleterm.lua
Normal file
1
.config/nvim/lua/goodhumored/plugins/toggleterm.lua
Normal file
@ -0,0 +1 @@
|
||||
return { "akinsho/toggleterm.nvim", version = "*", config = true }
|
Loading…
x
Reference in New Issue
Block a user