Nvim : Reformat config.

This commit is contained in:
Dmitry Voronin 2024-02-06 15:25:18 +03:00
parent 7da7d567a0
commit 9e2318b233
41 changed files with 398 additions and 410 deletions

View file

@ -3,21 +3,22 @@ require("key/Leader")
require("plugin/Init") require("plugin/Init")
require("config/Autoread") require("config/Autoread")
require("config/Etc")
require("config/Search") require("config/Search")
require("config/Tab") require("config/Tab")
require("config/Etc")
require("key/Filetree")
require("key/Lsp")
require("key/Whichkey")
require("key/Navigation")
require("key/Comment")
require("key/Gitsigns")
require("key/Trouble")
require("key/Terminal")
require("key/Autocomplete") require("key/Autocomplete")
require("key/Telescope") require("key/Comment")
require("key/Common") require("key/Common")
require("key/Todo") require("key/Filetree")
require("key/Fold") require("key/Fold")
require("key/Gitsigns")
require("key/Lsp")
require("key/Navigation")
require("key/Sort")
require("key/Telescope")
require("key/Terminal")
require("key/Todo")
require("key/Trouble")
require("key/Update") require("key/Update")
require("key/Whichkey")

View file

@ -1,21 +1,24 @@
-- TODO: add comments and separate files. -- TODO: Add comments and separate files.
vim.opt.number = true vim.opt.clipboard = "unnamedplus"
vim.opt.wildmode = 'longest,list' -- vim.opt.completeopt = "menuone,noselect"
-- vim.opt.completeopt = 'menuone,noselect'
vim.opt.cursorline = true vim.opt.cursorline = true
vim.opt.ttyfast = true
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.opt.clipboard = 'unnamedplus'
vim.opt.fixeol = false vim.opt.fixeol = false
vim.opt.number = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.ttyfast = true
vim.opt.wildmode = "longest,list"
-- Disable continuing comments on newline.
vim.cmd("autocmd BufEnter * set fo-=c fo-=r fo-=o") vim.cmd("autocmd BufEnter * set fo-=c fo-=r fo-=o")
vim.cmd("set mouse=") -- disable mouse.
-- disable signs for diagnostics. -- Disable mouse.
vim.cmd("set mouse=")
-- Disable signs for diagnostics.
vim.diagnostic.config({ signs = false }) vim.diagnostic.config({ signs = false })
-- Display for invisible characters. -- Display invisible characters.
-- vim.cmd("set list listchars=tab:>\\ ,trail:-,eol:,lead:.") -- vim.cmd("set list listchars=tab:>\\ ,trail:-,eol:,lead:.")
vim.cmd("set list listchars=tab:>\\ ,trail:-,lead:.") vim.cmd("set list listchars=tab:>\\ ,trail:-,lead:.")

View file

@ -1,5 +1,5 @@
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.showmatch = true
vim.opt.hlsearch = true vim.opt.hlsearch = true
vim.opt.ignorecase = true
vim.opt.incsearch = true vim.opt.incsearch = true
vim.opt.showmatch = true
vim.opt.smartcase = true

View file

@ -1,9 +1,9 @@
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
-- vim.opt.smartindent = true
vim.opt.expandtab = false
vim.opt.autoindent = true vim.opt.autoindent = true
vim.opt.expandtab = false
vim.opt.shiftwidth = 2
-- vim.opt.smartindent = true
vim.opt.softtabstop = 2
vim.opt.tabstop = 2
-- fix for markdown. -- Disable Markdown forced formatting.
vim.g.markdown_recommended_style = 0 vim.g.markdown_recommended_style = 0

View file

@ -1,4 +1,7 @@
require('key/Rekey') require("key/Rekey")
rekey_input('<C-Space>', '<C-n>') -- autocomplete. -- Autocomplete.
rekey_normal('<C-Space>', '<cmd>lua vim.lsp.buf.code_action()<cr>') -- LSP autocomplete. rekey_input("<C-Space>", "<C-n>")
-- LSP autocomplete.
rekey_normal("<C-Space>", "<cmd>lua vim.lsp.buf.code_action()<cr>")

View file

@ -1,2 +1,5 @@
vim.keymap.set("n", "<Leader>/", require("SingleComment").SingleComment, { expr = true }) -- toggle comment for selected line. -- Toggle comment for the selected line.
vim.keymap.set("v", "<Leader>/", require("SingleComment").Comment, {}) -- toggle comment for selected lines. vim.keymap.set("n", "<Leader>/", require("SingleComment").SingleComment, { expr = true })
-- Toggle comments for multiple lines.
vim.keymap.set("v", "<Leader>/", require("SingleComment").Comment, {})

View file

@ -1,4 +1,4 @@
require('key/Rekey') require("key/Rekey")
-- Write all we can and exit. Created this to drop non-writable stuff when piping to nvim. -- Write all we can and exit. Created this to drop non-writable stuff when piping to nvim.
function bye() function bye()
@ -6,12 +6,19 @@ function bye()
vim.cmd[[qa!]] vim.cmd[[qa!]]
end end
rekey_normal('<Leader>.', '@:') -- Repeat command. -- Repeat previous command.
rekey_visual('<Leader>.', '@:') -- Repeat command. rekey_normal("<Leader>.", "@:")
rekey_normal('zz', '<cmd>wa<cr>') -- Save all files. rekey_visual("<Leader>.", "@:")
rekey_normal('<Leader>z', '<cmd>lua bye()<cr>') -- Save & quit all.
rekey_normal('<Leader>v', 'v') -- Visual select (duplicate).
-- rekey_normal('<Leader>y', '"+y') -- Copy to system clipboard.
rekey_normal(';', ':') -- remap ; to :. -- Save everything.
rekey_visual(';', ':') -- remap ; to :. rekey_normal("zz", "<cmd>wa<cr>")
-- Save all we can and leave.
rekey_normal("<Leader>z", "<cmd>lua bye()<cr>")
-- Compatibility alias for visual selection.
rekey_normal("<Leader>v", "v")
-- Remap ; to :.
rekey_normal(";", ":")
rekey_visual(";", ":")

View file

@ -1,3 +1,4 @@
require('key/Rekey') require("key/Rekey")
rekey_normal('<Leader>1', '<cmd>NvimTreeToggle<cr>') -- toggle file tree. -- Toggle file tree.
rekey_normal("<Leader>1", "<cmd>NvimTreeToggle<cr>")

View file

@ -1,4 +1,7 @@
require('key/Rekey') require("key/Rekey")
remap_normal('<Leader>o', 'za') -- toggle fold. -- Toggle fold under cursor.
remap_normal('<Leader>O', 'zM') -- fold everything. remap_normal("<Leader>o", "za")
-- Fold everything.
remap_normal("<Leader>O", "zM")

View file

@ -1,3 +1,4 @@
require('key/Rekey') require("key/Rekey")
rekey_normal('<Leader>g', '<cmd>Gitsigns toggle_current_line_blame<cr><cmd>Gitsigns toggle_word_diff<cr><cmd>Gitsigns toggle_linehl<cr>') -- toggle git inspection mode. -- Toggle Git inspection mode.
rekey_normal("<Leader>g", "<cmd>Gitsigns toggle_current_line_blame<cr><cmd>Gitsigns toggle_word_diff<cr><cmd>Gitsigns toggle_linehl<cr>")

View file

@ -4,5 +4,6 @@ leader = " "
vim.g.mapleader = leader vim.g.mapleader = leader
vim.g.maplocalleader = leader vim.g.maplocalleader = leader
-- vim.api.nvim_set_keymap('', '<Space>', '<Nop>', { noremap = true, silent = true })
-- Disable key press timeout.
vim.cmd("set notimeout nottimeout") vim.cmd("set notimeout nottimeout")

View file

@ -1 +1 @@
require('key/Rekey') require("key/Rekey")

View file

@ -1,37 +1,31 @@
require('key/Rekey') require("key/Rekey")
-- switch windows. -- Switch windows.
rekey_normal('<Leader>w', '<C-w>k') rekey_normal("<Leader>a", "<C-w>h")
rekey_normal('<Leader>a', '<C-w>h') rekey_normal("<Leader>d", "<C-w>l")
rekey_normal('<Leader>s', '<C-w>j') rekey_normal("<Leader>s", "<C-w>j")
rekey_normal('<Leader>d', '<C-w>l') rekey_normal("<Leader>w", "<C-w>k")
-- switch buffers. -- Switch buffers.
-- rekey_normal('<Tab>', '<cmd>bnext<cr>') rekey_normal("<Leader>E", "<cmd>BufferLineMoveNext<cr>")
rekey_normal('<Leader>e', '<cmd>BufferLineCycleNext<cr>') rekey_normal("<Leader>Q", "<cmd>BufferLineMovePrev<cr>")
rekey_normal('<Leader>q', '<cmd>BufferLineCyclePrev<cr>') rekey_normal("<Leader>e", "<cmd>BufferLineCycleNext<cr>")
rekey_normal('<Leader>E', '<cmd>BufferLineMoveNext<cr>') rekey_normal("<Leader>q", "<cmd>BufferLineCyclePrev<cr>")
rekey_normal('<Leader>Q', '<cmd>BufferLineMovePrev<cr>')
-- close buffer. -- Close buffer.
-- rekey_normal('<Leader>x', '<cmd>bd!<cr>') rekey_normal("<Leader>x", "<cmd>bp<bar>sp<bar>bn<bar>bd<cr>")
rekey_normal('<Leader>x', '<cmd>bp<bar>sp<bar>bn<bar>bd<cr>')
-- splits. -- Close all hidden buffers.
rekey_normal('<Leader>\\', '<cmd>vsplit<cr>') rekey_normal("<Leader>X", "<cmd>BDelete hidden<cr><C-l>")
rekey_normal('<Leader>-', '<cmd>split<cr>')
rekey_normal('<Leader>=', '<C-w>=') -- equalize split sizes.
rekey_normal('<Leader>c', '<C-w>q') -- Close split.
rekey_normal('<Leader>W', '2<C-w>-')
rekey_normal('<Leader>S', '2<C-w>+')
rekey_normal('<Leader>A', '4<C-w><')
rekey_normal('<Leader>D', '4<C-w>>')
-- close all hidden buffers. -- Splits.
rekey_normal('<Leader>X', '<cmd>BDelete hidden<cr><C-l>') rekey_normal("<Leader>\\", "<cmd>vsplit<cr>")
rekey_normal("<Leader>-", "<cmd>split<cr>")
rekey_normal("<Leader>=", "<C-w>=") -- Equalize split sizes.
rekey_normal("<Leader>c", "<C-w>q") -- Close split.
-- navigate hjkl in insert mode. -- Resize splits.
rekey_input('<C-h>', '<Left>') rekey_normal("<Leader>A", "4<C-w><")
rekey_input('<C-j>', '<Down>') rekey_normal("<Leader>D", "4<C-w>>")
rekey_input('<C-k>', '<Up>') rekey_normal("<Leader>S", "2<C-w>+")
rekey_input('<C-l>', '<Right>') rekey_normal("<Leader>W", "2<C-w>-")

View file

@ -1,39 +1,49 @@
-- Base rekey function.
local function rekey(t, key, command) local function rekey(t, key, command)
vim.api.nvim_set_keymap(t, key, command, { noremap = true }) vim.api.nvim_set_keymap(t, key, command, { noremap = true })
end end
-- Base remap function.
local function remap(t, key, command) local function remap(t, key, command)
vim.api.nvim_set_keymap(t, key, command, { noremap = false }) vim.api.nvim_set_keymap(t, key, command, { noremap = false })
end end
-- Rekey in normal mode.
function rekey_normal(key, command) function rekey_normal(key, command)
rekey('n', key, command) rekey("n", key, command)
end end
-- Rekey in input mode.
function rekey_input(key, command) function rekey_input(key, command)
rekey('i', key, command) rekey("i", key, command)
end end
-- Rekey in visual mode.
function rekey_visual(key, command) function rekey_visual(key, command)
rekey('v', key, command) rekey("v", key, command)
end end
-- Rekey in terminal mode.
function rekey_terminal(key, command) function rekey_terminal(key, command)
rekey('t', key, command) rekey("t", key, command)
end end
-- Remap in normal mode.
function remap_normal(key, command) function remap_normal(key, command)
remap('n', key, command) remap("n", key, command)
end end
-- Remap in input mode.
function remap_input(key, command) function remap_input(key, command)
remap('i', key, command) remap("i", key, command)
end end
-- Remap in visual mode.
function remap_visual(key, command) function remap_visual(key, command)
remap('v', key, command) remap("v", key, command)
end end
-- Remap in terminal mode.
function remap_terminal(key, command) function remap_terminal(key, command)
remap('t', key, command) remap("t", key, command)
end end

View file

@ -0,0 +1,4 @@
require("key/Rekey")
-- Sort visual selection alphabetically.
rekey_visual("<Leader>A", ":'<,'>sort<cr>")

View file

@ -1,8 +1,8 @@
require('key/Rekey') require("key/Rekey")
rekey_normal('<Leader>ff', '<cmd>lua require("telescope.builtin").find_files()<cr>') rekey_normal("<Leader>fa", "<cmd>Telescope<cr>")
rekey_normal('<Leader>fg', '<cmd>lua require("telescope.builtin").live_grep()<cr>') rekey_normal("<Leader>fb", "<cmd>lua require('telescope.builtin').buffers()<cr>")
rekey_normal('<Leader>fb', '<cmd>lua require("telescope.builtin").buffers()<cr>') rekey_normal("<Leader>ff", "<cmd>lua require('telescope.builtin').find_files()<cr>")
rekey_normal('<Leader>fh', '<cmd>lua require("telescope.builtin").help_tags()<cr>') rekey_normal("<Leader>fg", "<cmd>lua require('telescope.builtin').live_grep()<cr>")
rekey_normal('<Leader>ft', '<cmd>Telescope treesitter<cr>') rekey_normal("<Leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<cr>")
rekey_normal('<Leader>fa', '<cmd>Telescope<cr>') rekey_normal("<Leader>ft", "<cmd>Telescope treesitter<cr>")

View file

@ -1,4 +1,7 @@
require('key/Rekey') require("key/Rekey")
rekey_normal('<Leader>4', '<cmd>terminal<cr>') -- Open terminal window.
rekey_terminal('<Esc>', '<C-\\><C-n>') rekey_normal("<Leader>4", "<cmd>terminal<cr>")
-- Detach from terminal with Esc key.
rekey_terminal("<Esc>", "<C-\\><C-n>")

View file

@ -1,3 +1,4 @@
require('key/Rekey') require("key/Rekey")
rekey_normal('<Leader>3', '<cmd>TroubleToggle todo<cr>') -- Toggle To-do window.
rekey_normal("<Leader>3", "<cmd>TroubleToggle todo<cr>")

View file

@ -1,3 +1,4 @@
require('key/Rekey') require("key/Rekey")
rekey_normal('<Leader>2', '<cmd>TroubleToggle document_diagnostics<cr>') -- Toggle diagnostics window.
rekey_normal("<Leader>2", "<cmd>TroubleToggle document_diagnostics<cr>")

View file

@ -1,4 +1,5 @@
vim.api.nvim_create_user_command('Update', function (args) -- Update all command.
vim.cmd('PackerUpdate') vim.api.nvim_create_user_command("Update", function (args)
vim.cmd('TSUpdate') vim.cmd("PackerUpdate")
vim.cmd("TSUpdate")
end, { desc = "Update everything." }) end, { desc = "Update everything." })

View file

@ -1,3 +1,4 @@
require("key/Rekey") require("key/Rekey")
-- Show keymap help.
rekey_normal("?", "<cmd>WhichKey<cr>") rekey_normal("?", "<cmd>WhichKey<cr>")

View file

@ -1,8 +1,7 @@
require('mini.align').setup { require("mini.align").setup {
-- Module mappings. Use `''` (empty string) to disable one.
mappings = { mappings = {
start = '<Leader>a', start = "<Leader>a",
start_with_preview = '<Leader>A', -- start_with_preview = '<Leader>A',
}, },
} }

View file

@ -1,11 +1,11 @@
require("autoclose").setup({ require("autoclose").setup({
keys = { keys = {
["\""] = { escape = true, close = true, pair = "\"\"", disabled_filetypes = {} },
["'"] = { escape = false, close = false, pair = "''", disabled_filetypes = {} }, ["'"] = { escape = false, close = false, pair = "''", disabled_filetypes = {} },
["{"] = { escape = true, close = true, pair = "{}", disabled_filetypes = {} },
["("] = { escape = true, close = true, pair = "()", disabled_filetypes = {} }, ["("] = { escape = true, close = true, pair = "()", disabled_filetypes = {} },
["<"] = { escape = true, close = true, pair = "<>", disabled_filetypes = {} }, ["<"] = { escape = true, close = true, pair = "<>", disabled_filetypes = {} },
["\""] = { escape = true, close = true, pair = "\"\"", disabled_filetypes = {} },
["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} }, ["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} },
["{"] = { escape = true, close = true, pair = "{}", disabled_filetypes = {} },
}, },
-- options = { -- options = {
-- disabled_filetypes = { "text", "markdown" }, -- disabled_filetypes = { "text", "markdown" },

View file

@ -1,7 +1,7 @@
require('close_buffers').setup({ require("close_buffers").setup({
filetype_ignore = {}, -- Filetype to ignore when running deletions file_glob_ignore = {},
file_glob_ignore = {}, -- File name glob pattern to ignore when running deletions (e.g. '*.md') file_regex_ignore = {},
file_regex_ignore = {}, -- File name regex pattern to ignore when running deletions (e.g. '.*[.]md') filetype_ignore = {},
preserve_window_layout = { 'this', 'nameless' }, -- Types of deletion that should preserve the window layout next_buffer_cmd = nil,
next_buffer_cmd = nil, -- Custom function to retrieve the next buffer when preserving window layout preserve_window_layout = { "this", "nameless" },
}) })

View file

@ -1,14 +1,11 @@
-- disable netrw at the very start of your init.lua -- Disable netrw at the very start of your init.lua.
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1
-- set termguicolors to enable highlight groups -- Set termguicolors to enable highlight groups.
vim.opt.termguicolors = true vim.opt.termguicolors = true
-- empty setup using defaults -- Setup nvim-tree.
-- require("nvim-tree").setup()
-- OR setup with some options
require("nvim-tree").setup({ require("nvim-tree").setup({
sort_by = "case_sensitive", sort_by = "case_sensitive",
view = { view = {

View file

@ -1,4 +1,3 @@
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldlevel = 99 vim.opt.foldlevel = 99
-- vim.api.nvim_create_autocmd({ "BufEnter" }, { pattern = { "*" }, command = "normal zx zR", }) -- telescope fix. vim.opt.foldmethod = "expr"

View file

@ -1,43 +1,43 @@
require('gitsigns').setup { require("gitsigns").setup {
signs = { signs = {
add = { text = '' }, add = { text = "" },
change = { text = '' }, change = { text = "" },
delete = { text = '_' }, changedelete = { text = "~" },
topdelete = { text = '' }, delete = { text = "_" },
changedelete = { text = '~' }, topdelete = { text = "" },
untracked = { text = '' }, untracked = { text = "" },
}, },
signcolumn = false, -- Toggle with `:Gitsigns toggle_signs` linehl = false,
numhl = true, -- Toggle with `:Gitsigns toggle_numhl` numhl = true,
linehl = false, -- Toggle with `:Gitsigns toggle_linehl` signcolumn = false,
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` word_diff = false,
watch_gitdir = { watch_gitdir = {
follow_files = true follow_files = true
}, },
attach_to_untracked = true, attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame = false,
current_line_blame_opts = { current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000, delay = 1000,
ignore_whitespace = false, ignore_whitespace = false,
virt_text = true,
virt_text_pos = "eol",
}, },
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>', current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
max_file_length = 40000,
sign_priority = 6, sign_priority = 6,
status_formatter = nil,
update_debounce = 100, update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = { preview_config = {
-- Options passed to nvim_open_win border = "single",
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1 col = 1
relative = "cursor",
row = 0,
style = "minimal",
}, },
yadm = { yadm = {
enable = false enable = false
}, },
} }
vim.cmd('highlight gitsignscurrentlineblame guibg=#00000000 guifg=#aaaaaa') -- Set custom color.
vim.cmd("highlight gitsignscurrentlineblame guibg=#00000000 guifg=#aaaaaa")

View file

@ -1 +1 @@
vim.cmd('colorscheme gruvbox-material') vim.cmd("colorscheme gruvbox-material")

View file

@ -1,12 +1,6 @@
require('indent-o-matic').setup { -- Auto-detect indentation type.
-- The values indicated here are the defaults require("indent-o-matic").setup {
-- Number of lines without indentation before giving up (use -1 for infinite)
max_lines = 1024, max_lines = 1024,
-- Space indentations that should be detected
standard_widths = { 2, 4, 8 },
-- Skip multi-line comments and strings (more accurate detection but less performant)
skip_multiline = true, skip_multiline = true,
standard_widths = { 2, 4, 8 },
} }

View file

@ -21,44 +21,33 @@ local available = function(commands)
end end
return require("packer").startup(function(use) return require("packer").startup(function(use)
--[[
host requirements
- gcc-c++
]]--
use "https://git.voronind.com/mirror/packer.nvim.git"
use "https://git.voronind.com/mirror/nvim-web-devicons.git"
use "https://git.voronind.com/mirror/nvim-tree.lua.git"
use "https://git.voronind.com/mirror/nvim-lspconfig.git"
use "https://git.voronind.com/mirror/which-key.nvim.git"
use "https://git.voronind.com/mirror/bufferline.nvim.git"
use "https://git.voronind.com/mirror/SingleComment.nvim.git" use "https://git.voronind.com/mirror/SingleComment.nvim.git"
use "https://git.voronind.com/mirror/lualine.nvim.git"
use "https://git.voronind.com/mirror/autoclose.nvim.git" use "https://git.voronind.com/mirror/autoclose.nvim.git"
use "https://git.voronind.com/mirror/mason.nvim.git" use "https://git.voronind.com/mirror/bufferline.nvim.git"
use "https://git.voronind.com/mirror/mason-lspconfig.nvim.git"
use "https://git.voronind.com/mirror/gitsigns.nvim.git"
use "https://git.voronind.com/mirror/trouble.nvim.git"
use "https://git.voronind.com/mirror/tokyonight.nvim.git"
use "https://git.voronind.com/mirror/close-buffers.nvim.git" use "https://git.voronind.com/mirror/close-buffers.nvim.git"
use "https://git.voronind.com/mirror/plenary.nvim.git" use "https://git.voronind.com/mirror/gitsigns.nvim.git"
use "https://git.voronind.com/mirror/telescope.nvim.git"
use "https://git.voronind.com/mirror/nvim-treesitter.git"
use "https://git.voronind.com/mirror/todo-comments.nvim.git"
use "https://git.voronind.com/mirror/gruvbox-material.git" use "https://git.voronind.com/mirror/gruvbox-material.git"
use "https://git.voronind.com/mirror/indent-o-matic.git" use "https://git.voronind.com/mirror/indent-o-matic.git"
use "https://git.voronind.com/mirror/lualine.nvim.git"
use "https://git.voronind.com/mirror/mason-lspconfig.nvim.git"
use "https://git.voronind.com/mirror/mason.nvim.git"
use "https://git.voronind.com/mirror/mini.align.git" use "https://git.voronind.com/mirror/mini.align.git"
use "https://git.voronind.com/mirror/nvim-lspconfig.git"
use "https://git.voronind.com/mirror/nvim-tree.lua.git"
use "https://git.voronind.com/mirror/nvim-treesitter.git"
use "https://git.voronind.com/mirror/nvim-web-devicons.git"
use "https://git.voronind.com/mirror/packer.nvim.git"
use "https://git.voronind.com/mirror/plenary.nvim.git"
use "https://git.voronind.com/mirror/telescope.nvim.git"
use "https://git.voronind.com/mirror/todo-comments.nvim.git"
use "https://git.voronind.com/mirror/tokyonight.nvim.git"
use "https://git.voronind.com/mirror/trouble.nvim.git"
use "https://git.voronind.com/mirror/which-key.nvim.git"
-- Automatically set up your configuration after cloning packer.nvim -- Plugin toggles.
-- Put this at the end after all plugins
if packer_bootstrap then
require("packer").sync()
end
-- plugin toggles.
local treesitter = true local treesitter = true
-- plugin setup. -- Plugin setup. Order is important.
require("plugin/Mason") require("plugin/Mason")
require("plugin/lsp/Init") require("plugin/lsp/Init")
require("plugin/Filetree") require("plugin/Filetree")
@ -81,4 +70,9 @@ return require("packer").startup(function(use)
require("plugin/Fold") require("plugin/Fold")
end end
end end
-- Auto-install.
if packer_bootstrap then
require("packer").sync()
end
end) end)

View file

@ -1,16 +1,16 @@
require('lualine').setup { require("lualine").setup {
options = { options = {
-- theme = "ayu_mirage",
icons_enabled = true, icons_enabled = true,
-- theme = 'ayu_mirage', component_separators = { left = "", right = ""},
component_separators = { left = '', right = ''}, section_separators = { left = "", right = ""},
section_separators = { left = '', right = ''},
disabled_filetypes = { disabled_filetypes = {
statusline = {}, statusline = {},
winbar = {}, winbar = {},
}, },
ignore_focus = {},
always_divide_middle = true, always_divide_middle = true,
globalstatus = false, globalstatus = false,
ignore_focus = {},
refresh = { refresh = {
statusline = 1000, statusline = 1000,
tabline = 1000, tabline = 1000,
@ -18,23 +18,23 @@ require('lualine').setup {
} }
}, },
sections = { sections = {
lualine_a = {'mode'}, lualine_a = {"mode"},
lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_b = {"branch", "diff", "diagnostics"},
lualine_c = {'filename'}, lualine_c = {"filename"},
lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_x = {"encoding", "fileformat", "filetype"},
lualine_y = {'progress'}, lualine_y = {"progress"},
lualine_z = {'location'} lualine_z = {"location"}
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = {'filename'}, lualine_c = {"filename"},
lualine_x = {'location'}, lualine_x = {"location"},
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {}
}, },
extensions = {}
inactive_winbar = {},
tabline = {}, tabline = {},
winbar = {}, winbar = {},
inactive_winbar = {},
extensions = {}
} }

View file

@ -1,30 +1,11 @@
require('telescope').setup{ require("telescope").setup{
defaults = { defaults = {
-- Default configuration for telescope goes here:
-- config_key = value,
mappings = { mappings = {
i = { i = {
-- map actions.which_key to <C-h> (default: <C-/>) ["<C-?>"] = "which_key"
-- actions.which_key shows the mappings for your picker,
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
["<C-h>"] = "which_key"
} }
} }
}, },
pickers = { extensions = { }
-- Default configuration for builtin pickers goes here: pickers = { },
-- picker_name = {
-- picker_config_key = value,
-- ...
-- }
-- Now the picker_config_key will be applied every time you call this
-- builtin picker
},
extensions = {
-- Your extension configuration goes here:
-- extension_name = {
-- extension_config_key = value,
-- }
-- please take a look at the readme of the extension you want to configure
}
} }

View file

@ -1,51 +1,43 @@
require('todo-comments').setup { require("todo-comments").setup {
signs = false, -- show icons in the signs column sign_priority = 8,
sign_priority = 8, -- sign priority signs = false,
-- keywords recognized as todo comments
keywords = { keywords = {
FIX = { FIX = {
icon = "", -- icon used for the sign, and in search results alt = { "FIXME", "BUG", "FIXIT", "ISSUE" },
color = "error", -- can be a hex color, or a named color (see below) color = "error",
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords icon = "",
-- signs = false, -- configure signs for some keywords individually
}, },
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" }, HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } }, NOTE = { icon = "", color = "hint", alt = { "INFO" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
TODO = { icon = "", color = "info" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
}, },
gui_style = { gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group. bg = "BOLD",
bg = "BOLD", -- The gui style to use for the bg highlight group. fg = "NONE",
}, },
merge_keywords = true, -- when true, custom keywords will be merged with the defaults merge_keywords = true,
-- highlighting of the line containing the todo comment
-- * before: highlights before the keyword (typically comment characters)
-- * keyword: highlights of the keyword
-- * after: highlights after the keyword (todo text)
highlight = { highlight = {
multiline = true, -- enable multine todo comments after = "fg",
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword before = "",
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line comments_only = true,
before = "", -- "fg" or "bg" or empty exclude = {},
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg) keyword = "wide",
after = "fg", -- "fg" or "bg" or empty max_line_len = 400,
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex) multiline = true,
comments_only = true, -- uses treesitter to match keywords in comments only multiline_context = 10,
max_line_len = 400, -- ignore lines longer than this multiline_pattern = "^.",
exclude = {}, -- list of file types to exclude highlighting pattern = [[.*<(KEYWORDS)\s*:]],
}, },
-- list of named colors where we try to extract the guifg from the
-- list of highlight groups or use the hex color if hl not found as a fallback
colors = { colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" }, default = { "Identifier", "#7C3AED" },
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
hint = { "DiagnosticHint", "#10B981" },
info = { "DiagnosticInfo", "#2563EB" },
test = { "Identifier", "#FF00FF" } test = { "Identifier", "#FF00FF" }
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
}, },
search = { search = {
command = "rg", command = "rg",
@ -56,9 +48,6 @@ require('todo-comments').setup {
"--line-number", "--line-number",
"--column", "--column",
}, },
-- regex that will be used to match keywords. pattern = [[\b(KEYWORDS):]],
-- don't replace the (KEYWORDS) placeholder
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
}, },
} }

View file

@ -1,37 +1,23 @@
require("tokyonight").setup({ require("tokyonight").setup({
-- your configuration comes here light_style = "night",
-- or leave it empty to use the default settings style = "night",
style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` terminal_colors = true,
light_style = "night", -- The theme is used when the background is set to light transparent = false,
transparent = false, -- Enable this to disable setting the background color
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in [Neovim](https://github.com/neovim/neovim)
styles = { styles = {
-- Style to be applied to different syntax groups
-- Value is any valid attr-list value for `:help nvim_set_hl`
comments = { italic = true }, comments = { italic = true },
keywords = { italic = true }, floats = "dark",
functions = {}, functions = {},
keywords = { italic = true },
sidebars = "dark",
variables = {}, variables = {},
-- Background styles. Can be "dark", "transparent" or "normal"
sidebars = "dark", -- style for sidebars, see below
floats = "dark", -- style for floating windows
}, },
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` day_brightness = 0.3,
day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors dim_inactive = false,
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. hide_inactive_statusline = false,
dim_inactive = false, -- dims inactive windows lualine_bold = false,
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
--- You can override specific color groups to use other groups or a hex color
--- function will be called with a ColorScheme table
---@param colors ColorScheme
on_colors = function(colors) end, on_colors = function(colors) end,
--- You can override specific highlights to use other groups or a hex color
--- function will be called with a Highlights and ColorScheme table
---@param highlights Highlights
---@param colors ColorScheme
on_highlights = function(highlights, colors) end, on_highlights = function(highlights, colors) end,
sidebars = { "qf", "help" },
}) })
vim.cmd[[colorscheme tokyonight]] -- vim.cmd[[colorscheme tokyonight]]

View file

@ -1,18 +1,14 @@
require('nvim-treesitter.configs').setup { require("nvim-treesitter.configs").setup {
auto_install = false,
ensure_installed = "all", ensure_installed = "all",
sync_install = false, sync_install = false,
auto_install = false,
-- ignore_install = { "javascript" },
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = { highlight = {
additional_vim_regex_highlighting = false,
enable = true, enable = true,
use_languagetree = true, use_languagetree = true,
-- disable = { "c" },
additional_vim_regex_highlighting = false,
}, },
indent = { indent = {
enable = true, enable = true,
-- disable = {"python"}
}, },
autotag = { autotag = {
enable = true enable = true

View file

@ -1 +1 @@
require('trouble').setup() require("trouble").setup()

View file

@ -1,4 +1,4 @@
require('plugin/lsp/Rust') -- require("plugin/lsp/Kotlin")
-- require('plugin/lsp/Kotlin') -- require("plugin/lsp/Python")
-- require('plugin/lsp/Python') require("plugin/lsp/Rust")
require('plugin/lsp/Tex') require("plugin/lsp/Tex")

View file

@ -1,3 +1,3 @@
local lspconfig = require('lspconfig') local lspconfig = require("lspconfig")
lspconfig.kotlin_language_server.setup {} lspconfig.kotlin_language_server.setup {}

View file

@ -1,3 +1,3 @@
local lspconfig = require('lspconfig') local lspconfig = require("lspconfig")
lspconfig.pyright.setup {} lspconfig.pyright.setup {}

View file

@ -4,7 +4,10 @@ lspconfig.rust_analyzer.setup {
settings = { settings = {
["rust-analyzer"] = { ["rust-analyzer"] = {
rustfmt = { rustfmt = {
extraArgs = { "--config", "tab_spaces=2", "brace_style=AlwaysNextLine", "control_brace_style=AlwaysNextLine" } extraArgs = {
"--config",
"hard_tabs=true",
}
} }
}, },
}, },

View file

@ -1,8 +1,19 @@
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
local config = { local config = {
filetypes = { 'text', 'bib', 'gitcommit', 'markdown', 'org', 'plaintex', 'rst', 'rnoweb', 'tex', 'pandoc' }, filetypes = {
"bib",
"gitcommit",
"markdown",
"org",
"pandoc",
"plaintex",
"rnoweb",
"rst",
"tex",
"text",
},
settings = { settings = {
['ltex'] = { ["ltex"] = {
language = "auto" language = "auto"
} }
} }
@ -10,43 +21,44 @@ local config = {
lspconfig.ltex.setup(config) lspconfig.ltex.setup(config)
vim.api.nvim_create_user_command('SCOn', function (args) -- Use TeX LSP for spellcheck.
vim.api.nvim_create_user_command("SCOn", function (args)
lspconfig.ltex.setup(config) lspconfig.ltex.setup(config)
end, { desc = "Enable spellcheck." }) end, { desc = "Enable spellcheck." })
vim.api.nvim_create_user_command('SCOff', function (args) vim.api.nvim_create_user_command("SCOff", function (args)
lspconfig.ltex.setup { filetypes = {} } lspconfig.ltex.setup { filetypes = {} }
end, { desc = "Disable spellcheck." }) end, { desc = "Disable spellcheck." })
vim.api.nvim_create_user_command('SCLangRU', function (args) vim.api.nvim_create_user_command("SCLangRU", function (args)
config.settings['ltex'].language = "ru-RU" config.settings['ltex'].language = "ru-RU"
lspconfig.ltex.setup(config) lspconfig.ltex.setup(config)
end, { desc = "Set spellcheck to Russian." }) end, { desc = "Set spellcheck to Russian." })
vim.api.nvim_create_user_command('SCLangEN', function (args) vim.api.nvim_create_user_command("SCLangEN", function (args)
config.settings['ltex'].language = "en-US" config.settings['ltex'].language = "en-US"
lspconfig.ltex.setup(config) lspconfig.ltex.setup(config)
end, { desc = "Set spellcheck to English." }) end, { desc = "Set spellcheck to English." })
vim.api.nvim_create_user_command('SCLangAuto', function (args) vim.api.nvim_create_user_command("SCLangAuto", function (args)
config.settings['ltex'].language = "auto" config.settings['ltex'].language = "auto"
lspconfig.ltex.setup(config) lspconfig.ltex.setup(config)
end, { desc = "Set spellcheck to Auto." }) end, { desc = "Set spellcheck to Auto." })
vim.api.nvim_create_user_command('SCForce', function (args) vim.api.nvim_create_user_command("SCForce", function (args)
vim.cmd("setfiletype text") vim.cmd("setfiletype text")
vim.cmd("SCOn") vim.cmd("SCOn")
end, { desc = "Set buffer type to text." }) end, { desc = "Set buffer type to text." })
vim.api.nvim_create_user_command('SCReset', function (args) vim.api.nvim_create_user_command("SCReset", function (args)
vim.cmd("filetype detect") vim.cmd("filetype detect")
vim.cmd("SCLangAuto") vim.cmd("SCLangAuto")
end, { desc = "Set buffer type to auto." }) end, { desc = "Set buffer type to auto." })
vim.api.nvim_create_user_command('SCInfo', function (args) vim.api.nvim_create_user_command("SCInfo", function (args)
vim.cmd("LspInfo") vim.cmd("LspInfo")
end, { desc = "Show info about spellcheck." }) end, { desc = "Show info about spellcheck." })
vim.api.nvim_create_user_command('SCInstall', function (args) vim.api.nvim_create_user_command("SCInstall", function (args)
vim.cmd("MasonInstall ltex-ls") vim.cmd("MasonInstall ltex-ls")
end, { desc = "Install spellcheck (requires Mason)." }) end, { desc = "Install spellcheck (requires Mason)." })