Add initial configs

This commit is contained in:
2026-05-25 00:32:00 +03:00
parent 18fe98a122
commit bc1c135526
34 changed files with 1330 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
/plugin
+4
View File
@@ -0,0 +1,4 @@
vim.opt_local.expandtab = false
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4
+4
View File
@@ -0,0 +1,4 @@
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4
vim.opt_local.colorcolumn = '80'
+30
View File
@@ -0,0 +1,30 @@
local function keymap()
if vim.o.iminsert == 1 then
return 'RU'
else
return ''
end
end
local function fileinfo()
return string.format('%s[%s]', vim.bo.fileencoding, vim.bo.fileformat)
end
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'edge',
component_separators = { left = '|', right = '|' },
section_separators = {},
globalstatus = true,
},
sections = {
lualine_a = { 'mode', keymap },
lualine_b = { 'FugitiveHead' },
lualine_c = { 'filename' },
lualine_x = { 'filetype', fileinfo },
lualine_y = { 'progress' },
lualine_z = { 'location' },
},
extensions = { 'quickfix', 'fugitive' },
}
+34
View File
@@ -0,0 +1,34 @@
local telescope = require('telescope')
local actions = require('telescope.actions')
telescope.setup({
defaults = {
layout_config = {
prompt_position = 'bottom',
horizontal = {
width_padding = 0.04,
height_padding = 0.1,
preview_width = 0.6,
},
vertical = {
width_padding = 0.05,
height_padding = 1,
preview_height = 0.5,
},
},
mappings = {
i = {
['<C-x>'] = false,
['<C-s>'] = actions.select_horizontal,
},
},
},
})
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<C-p>', builtin.git_files)
vim.keymap.set('n', '<leader>ff', builtin.find_files)
vim.keymap.set('n', '<leader>fg', builtin.live_grep)
vim.keymap.set('n', '<leader>fh', builtin.help_tags)
+3
View File
@@ -0,0 +1,3 @@
require('config.plugins')
require('config.set')
require('config.remap')
+73
View File
@@ -0,0 +1,73 @@
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd.packadd 'packer.nvim'
end
require('packer').startup(function(use)
use('wbthomason/packer.nvim')
-- Appearance
use {
'sainnhe/edge',
config = function()
vim.g.edge_transparent_background = 2
vim.g.edge_better_performance = 1
vim.g.edge_enable_italic = false
vim.cmd.colorscheme 'edge'
end,
}
use('nvim-tree/nvim-web-devicons')
use('hoob3rt/lualine.nvim')
-- File navigation
use {
'nvim-telescope/telescope.nvim',
requires = {
'nvim-lua/plenary.nvim',
'nvim-lua/popup.nvim',
},
}
use {
'stevearc/oil.nvim',
config = function()
require('oil').setup({ view_options = { show_hidden = true } })
vim.keymap.set('n', '-', ':Oil<CR>')
end
}
-- Editing
use {
'numToStr/Comment.nvim',
config = function()
require('Comment').setup({ ignore = '^$' })
end,
}
use('tpope/vim-surround')
use('tpope/vim-repeat')
use {
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = function()
require('nvim-autopairs').setup()
end,
}
-- Miscellaneous
use('tpope/vim-fugitive')
use {
'nathom/filetype.nvim',
setup = function()
vim.g.did_load_filetypes = 1
end,
}
if packer_bootstrap then
require('packer').sync()
end
end)
if vim.fn.exists('g:loaded_matchit') == 0 then
vim.cmd('runtime! macros/matchit.vim')
end
+31
View File
@@ -0,0 +1,31 @@
vim.g.mapleader = ' '
vim.keymap.set('n', 'Q', '<nop>')
vim.keymap.set('n', '<C-h>', '<C-w>h')
vim.keymap.set('n', '<C-j>', '<C-w>j')
vim.keymap.set('n', '<C-k>', '<C-w>k')
vim.keymap.set('n', '<C-l>', '<C-w>l')
vim.keymap.set('n', '<Right>', ':vertical resize +2<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<Left>', ':vertical resize -2<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<Up>', ':resize +2<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<Down>', ':resize -2<CR>', { noremap = true, silent = true })
vim.keymap.set('n', 'n', 'nzzzv')
vim.keymap.set('n', 'N', 'Nzzzv')
vim.keymap.set('n', '<C-d>', '<C-d>zz')
vim.keymap.set('n', '<C-u>', '<C-u>zz')
vim.keymap.set('n', 'J', 'v:count ? \'J\' : \'mzJ`z\'', { expr = true })
vim.keymap.set('n', '<leader>y', '\"+y')
vim.keymap.set('v', '<leader>y', '\"+y')
vim.cmd [[
function! Sort(type, ...)
'[,']sort
endfunction
nnoremap <silent> gs :set opfunc=Sort<CR>g@
]]
vim.keymap.set('i', '<C-j>', '<C-^>')
+44
View File
@@ -0,0 +1,44 @@
vim.opt.updatetime = 50
vim.opt.lazyredraw = true
vim.opt.swapfile = false
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.background = 'dark'
vim.opt.termguicolors = true
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.winborder = 'rounded'
vim.opt.smartindent = true
vim.opt.copyindent = true
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = -1
vim.opt.shiftround = true
vim.opt.wrap = false
vim.opt.scrolloff = 5
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.cmdheight = 2
vim.opt.showmode = false
vim.opt.confirm = true
vim.opt.wildmode = 'longest,list,full'
vim.opt.wildignorecase = true
vim.opt.completeopt = 'menuone,noselect'
vim.opt.shortmess:append('c')
vim.opt.diffopt:append('internal,algorithm:patience')
vim.opt.keymap = 'russian-jcukenwin'
vim.opt.spelllang = 'en_us,ru_yo'
vim.opt.iminsert = 0