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("config/Autoread")
require("config/Etc")
require("config/Search")
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/Telescope")
require("key/Comment")
require("key/Common")
require("key/Todo")
require("key/Filetree")
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/Whichkey")

View file

@ -1,21 +1,24 @@
-- TODO: add comments and separate files.
vim.opt.number = true
vim.opt.wildmode = 'longest,list'
-- vim.opt.completeopt = 'menuone,noselect'
-- TODO: Add comments and separate files.
vim.opt.clipboard = "unnamedplus"
-- vim.opt.completeopt = "menuone,noselect"
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.number = true
vim.opt.splitbelow = true
vim.opt.splitright = 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("set mouse=") -- disable mouse.
-- disable signs for diagnostics.
-- Disable mouse.
vim.cmd("set mouse=")
-- Disable signs for diagnostics.
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:-,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.ignorecase = 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.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

View file

@ -1,4 +1,7 @@
require('key/Rekey')
require("key/Rekey")
rekey_input('<C-Space>', '<C-n>') -- autocomplete.
rekey_normal('<C-Space>', '<cmd>lua vim.lsp.buf.code_action()<cr>') -- LSP autocomplete.
-- 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.
vim.keymap.set("v", "<Leader>/", require("SingleComment").Comment, {}) -- toggle comment for selected lines.
-- Toggle comment for the selected line.
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.
function bye()
@ -6,12 +6,19 @@ function bye()
vim.cmd[[qa!]]
end
rekey_normal('<Leader>.', '@:') -- Repeat command.
rekey_visual('<Leader>.', '@:') -- Repeat command.
rekey_normal('zz', '<cmd>wa<cr>') -- Save all files.
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.
-- Repeat previous command.
rekey_normal("<Leader>.", "@:")
rekey_visual("<Leader>.", "@:")
rekey_normal(';', ':') -- remap ; to :.
rekey_visual(';', ':') -- remap ; to :.
-- Save everything.
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.
remap_normal('<Leader>O', 'zM') -- fold everything.
-- Toggle fold under cursor.
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.maplocalleader = leader
-- vim.api.nvim_set_keymap('', '<Space>', '<Nop>', { noremap = true, silent = true })
-- Disable key press timeout.
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.
rekey_normal('<Leader>w', '<C-w>k')
rekey_normal('<Leader>a', '<C-w>h')
rekey_normal('<Leader>s', '<C-w>j')
rekey_normal('<Leader>d', '<C-w>l')
-- Switch windows.
rekey_normal("<Leader>a", "<C-w>h")
rekey_normal("<Leader>d", "<C-w>l")
rekey_normal("<Leader>s", "<C-w>j")
rekey_normal("<Leader>w", "<C-w>k")
-- switch buffers.
-- rekey_normal('<Tab>', '<cmd>bnext<cr>')
rekey_normal('<Leader>e', '<cmd>BufferLineCycleNext<cr>')
rekey_normal('<Leader>q', '<cmd>BufferLineCyclePrev<cr>')
rekey_normal('<Leader>E', '<cmd>BufferLineMoveNext<cr>')
rekey_normal('<Leader>Q', '<cmd>BufferLineMovePrev<cr>')
-- Switch buffers.
rekey_normal("<Leader>E", "<cmd>BufferLineMoveNext<cr>")
rekey_normal("<Leader>Q", "<cmd>BufferLineMovePrev<cr>")
rekey_normal("<Leader>e", "<cmd>BufferLineCycleNext<cr>")
rekey_normal("<Leader>q", "<cmd>BufferLineCyclePrev<cr>")
-- close buffer.
-- rekey_normal('<Leader>x', '<cmd>bd!<cr>')
rekey_normal('<Leader>x', '<cmd>bp<bar>sp<bar>bn<bar>bd<cr>')
-- Close buffer.
rekey_normal("<Leader>x", "<cmd>bp<bar>sp<bar>bn<bar>bd<cr>")
-- splits.
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.
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.
rekey_normal("<Leader>X", "<cmd>BDelete hidden<cr><C-l>")
-- close all hidden buffers.
rekey_normal('<Leader>X', '<cmd>BDelete hidden<cr><C-l>')
-- Splits.
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.
rekey_input('<C-h>', '<Left>')
rekey_input('<C-j>', '<Down>')
rekey_input('<C-k>', '<Up>')
rekey_input('<C-l>', '<Right>')
-- Resize splits.
rekey_normal("<Leader>A", "4<C-w><")
rekey_normal("<Leader>D", "4<C-w>>")
rekey_normal("<Leader>S", "2<C-w>+")
rekey_normal("<Leader>W", "2<C-w>-")

View file

@ -1,39 +1,49 @@
-- Base rekey function.
local function rekey(t, key, command)
vim.api.nvim_set_keymap(t, key, command, { noremap = true })
end
-- Base remap function.
local function remap(t, key, command)
vim.api.nvim_set_keymap(t, key, command, { noremap = false })
end
-- Rekey in normal mode.
function rekey_normal(key, command)
rekey('n', key, command)
rekey("n", key, command)
end
-- Rekey in input mode.
function rekey_input(key, command)
rekey('i', key, command)
rekey("i", key, command)
end
-- Rekey in visual mode.
function rekey_visual(key, command)
rekey('v', key, command)
rekey("v", key, command)
end
-- Rekey in terminal mode.
function rekey_terminal(key, command)
rekey('t', key, command)
rekey("t", key, command)
end
-- Remap in normal mode.
function remap_normal(key, command)
remap('n', key, command)
remap("n", key, command)
end
-- Remap in input mode.
function remap_input(key, command)
remap('i', key, command)
remap("i", key, command)
end
-- Remap in visual mode.
function remap_visual(key, command)
remap('v', key, command)
remap("v", key, command)
end
-- Remap in terminal mode.
function remap_terminal(key, command)
remap('t', key, command)
remap("t", key, command)
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>fg', '<cmd>lua require("telescope.builtin").live_grep()<cr>')
rekey_normal('<Leader>fb', '<cmd>lua require("telescope.builtin").buffers()<cr>')
rekey_normal('<Leader>fh', '<cmd>lua require("telescope.builtin").help_tags()<cr>')
rekey_normal('<Leader>ft', '<cmd>Telescope treesitter<cr>')
rekey_normal('<Leader>fa', '<cmd>Telescope<cr>')
rekey_normal("<Leader>fa", "<cmd>Telescope<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>fg", "<cmd>lua require('telescope.builtin').live_grep()<cr>")
rekey_normal("<Leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<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>')
rekey_terminal('<Esc>', '<C-\\><C-n>')
-- Open terminal window.
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)
vim.cmd('PackerUpdate')
vim.cmd('TSUpdate')
-- Update all command.
vim.api.nvim_create_user_command("Update", function (args)
vim.cmd("PackerUpdate")
vim.cmd("TSUpdate")
end, { desc = "Update everything." })

View file

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

View file

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

View file

@ -1,11 +1,11 @@
require("autoclose").setup({
keys = {
["\""] = { escape = true, close = true, 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 = 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 = {} },
},
-- options = {
-- disabled_filetypes = { "text", "markdown" },

View file

@ -1,7 +1,7 @@
require('close_buffers').setup({
filetype_ignore = {}, -- Filetype to ignore when running deletions
file_glob_ignore = {}, -- File name glob pattern to ignore when running deletions (e.g. '*.md')
file_regex_ignore = {}, -- File name regex pattern to ignore when running deletions (e.g. '.*[.]md')
preserve_window_layout = { 'this', 'nameless' }, -- Types of deletion that should preserve the window layout
next_buffer_cmd = nil, -- Custom function to retrieve the next buffer when preserving window layout
require("close_buffers").setup({
file_glob_ignore = {},
file_regex_ignore = {},
filetype_ignore = {},
next_buffer_cmd = nil,
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_netrwPlugin = 1
-- set termguicolors to enable highlight groups
-- Set termguicolors to enable highlight groups.
vim.opt.termguicolors = true
-- empty setup using defaults
-- require("nvim-tree").setup()
-- OR setup with some options
-- Setup nvim-tree.
require("nvim-tree").setup({
sort_by = "case_sensitive",
view = {
@ -18,7 +15,7 @@ require("nvim-tree").setup({
group_empty = true,
},
filters = {
dotfiles = false,
dotfiles = false,
git_ignored = false
},
})

View file

@ -1,4 +1,3 @@
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
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 = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
add = { text = "" },
change = { text = "" },
changedelete = { text = "~" },
delete = { text = "_" },
topdelete = { text = "" },
untracked = { text = "" },
},
signcolumn = false, -- Toggle with `:Gitsigns toggle_signs`
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
linehl = false,
numhl = true,
signcolumn = false,
word_diff = false,
watch_gitdir = {
follow_files = true
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame = false,
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
delay = 1000,
ignore_whitespace = false,
virt_text = true,
virt_text_pos = "eol",
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
max_file_length = 40000,
sign_priority = 6,
status_formatter = nil,
update_debounce = 100,
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
border = "single",
col = 1
relative = "cursor",
row = 0,
style = "minimal",
},
yadm = {
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 {
-- The values indicated here are the defaults
-- Number of lines without indentation before giving up (use -1 for infinite)
max_lines = 1024,
-- Space indentations that should be detected
-- Auto-detect indentation type.
require("indent-o-matic").setup {
max_lines = 1024,
skip_multiline = true,
standard_widths = { 2, 4, 8 },
-- Skip multi-line comments and strings (more accurate detection but less performant)
skip_multiline = true,
}

View file

@ -21,44 +21,33 @@ local available = function(commands)
end
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/lualine.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/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/bufferline.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/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/gitsigns.nvim.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/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/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
-- Put this at the end after all plugins
if packer_bootstrap then
require("packer").sync()
end
-- plugin toggles.
-- Plugin toggles.
local treesitter = true
-- plugin setup.
-- Plugin setup. Order is important.
require("plugin/Mason")
require("plugin/lsp/Init")
require("plugin/Filetree")
@ -81,4 +70,9 @@ return require("packer").startup(function(use)
require("plugin/Fold")
end
end
-- Auto-install.
if packer_bootstrap then
require("packer").sync()
end
end)

View file

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

View file

@ -1,30 +1,11 @@
require('telescope').setup{
defaults = {
-- Default configuration for telescope goes here:
-- config_key = value,
mappings = {
i = {
-- map actions.which_key to <C-h> (default: <C-/>)
-- 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 = {
-- Default configuration for builtin pickers goes here:
-- 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
}
require("telescope").setup{
defaults = {
mappings = {
i = {
["<C-?>"] = "which_key"
}
}
},
extensions = { }
pickers = { },
}

View file

@ -1,64 +1,53 @@
require('todo-comments').setup {
signs = false, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group.
bg = "BOLD", -- The gui style to use for the bg highlight group.
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- 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 = {
multiline = true, -- enable multine todo comments
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
before = "", -- "fg" or "bg" or empty
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)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
-- 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 = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" }
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
-- regex that will be used to match 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
},
require("todo-comments").setup {
sign_priority = 8,
signs = false,
keywords = {
FIX = {
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" },
color = "error",
icon = "",
},
HACK = { icon = "", color = "warning" },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
TODO = { icon = "", color = "info" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
},
gui_style = {
bg = "BOLD",
fg = "NONE",
},
merge_keywords = true,
highlight = {
after = "fg",
before = "",
comments_only = true,
exclude = {},
keyword = "wide",
max_line_len = 400,
multiline = true,
multiline_context = 10,
multiline_pattern = "^.",
pattern = [[.*<(KEYWORDS)\s*:]],
},
colors = {
default = { "Identifier", "#7C3AED" },
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
hint = { "DiagnosticHint", "#10B981" },
info = { "DiagnosticInfo", "#2563EB" },
test = { "Identifier", "#FF00FF" }
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
pattern = [[\b(KEYWORDS):]],
},
}

View file

@ -1,37 +1,23 @@
require("tokyonight").setup({
-- your configuration comes here
-- or leave it empty to use the default settings
style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
light_style = "night", -- The theme is used when the background is set to light
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 = {
-- Style to be applied to different syntax groups
-- Value is any valid attr-list value for `:help nvim_set_hl`
comments = { italic = true },
keywords = { italic = true },
functions = {},
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, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
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**.
dim_inactive = false, -- dims inactive windows
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,
--- 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,
light_style = "night",
style = "night",
terminal_colors = true,
transparent = false,
styles = {
comments = { italic = true },
floats = "dark",
functions = {},
keywords = { italic = true },
sidebars = "dark",
variables = {},
},
day_brightness = 0.3,
dim_inactive = false,
hide_inactive_statusline = false,
lualine_bold = false,
on_colors = function(colors) end,
on_highlights = function(highlights, colors) end,
sidebars = { "qf", "help" },
})
vim.cmd[[colorscheme tokyonight]]
-- vim.cmd[[colorscheme tokyonight]]

View file

@ -1,23 +1,19 @@
require('nvim-treesitter.configs').setup {
ensure_installed = "all",
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 = {
enable = true,
use_languagetree = true,
-- disable = { "c" },
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
-- disable = {"python"}
},
autotag = {
enable = true
},
rainbow = {
enable = true
},
require("nvim-treesitter.configs").setup {
auto_install = false,
ensure_installed = "all",
sync_install = false,
highlight = {
additional_vim_regex_highlighting = false,
enable = true,
use_languagetree = true,
},
indent = {
enable = true,
},
autotag = {
enable = true
},
rainbow = {
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/Python')
require('plugin/lsp/Tex')
-- require("plugin/lsp/Kotlin")
-- require("plugin/lsp/Python")
require("plugin/lsp/Rust")
require("plugin/lsp/Tex")

View file

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

View file

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

View file

@ -4,7 +4,10 @@ lspconfig.rust_analyzer.setup {
settings = {
["rust-analyzer"] = {
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 config = {
filetypes = { 'text', 'bib', 'gitcommit', 'markdown', 'org', 'plaintex', 'rst', 'rnoweb', 'tex', 'pandoc' },
filetypes = {
"bib",
"gitcommit",
"markdown",
"org",
"pandoc",
"plaintex",
"rnoweb",
"rst",
"tex",
"text",
},
settings = {
['ltex'] = {
["ltex"] = {
language = "auto"
}
}
@ -10,43 +21,44 @@ local 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)
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 = {} }
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"
lspconfig.ltex.setup(config)
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"
lspconfig.ltex.setup(config)
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"
lspconfig.ltex.setup(config)
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("SCOn")
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("SCLangAuto")
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")
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")
end, { desc = "Install spellcheck (requires Mason)." })