Nvim: move config to lua, first step

This commit is contained in:
Robert Kmieć
2022-12-30 11:52:52 +01:00
parent f377e88a6c
commit 6d2af89197
4 changed files with 161 additions and 143 deletions

View File

@@ -0,0 +1,97 @@
vim.g.loaded = 1
vim.g.loaded_netrwPlugin = 1
vim.g.plug_install = 0
vim.opt.termguicolors = true
vim.opt.shell = '/bin/bash'
vim.opt.number = true
--vim.o.relativenumber = 1
vim.opt.numberwidth = 1
vim.opt.clipboard = "unnamedplus"
vim.opt.showmode = true
vim.opt.laststatus = 2
vim.opt.background = 'dark'
vim.opt.splitbelow = true
vim.opt.splitright = true
-- gui settings
vim.opt.guifont="IBM Plex Mono Text:h9:e-subpixelantyalias"
vim.g.neovide_cursor_vfx_mode = 'pixiedust'
vim.g.neovide_refresh_rate = 120
vim.g.neovide_refresh_rate_idle = 5
vim.g.neovide_remember_window_size = 0
vim.opt.listchars = { tab = "", trail = "¬" }
vim.opt.list = true
vim.opt.tabstop=2
vim.opt.shiftwidth=2
vim.opt.softtabstop=2
vim.opt.expandtab = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.gdefault = true
vim.opt.textwidth = 80
vim.opt.colorcolumn = { 80 }
vim.opt.formatoptions:append("tlo/qj")
vim.opt.scrolloff = 10
vim.opt.wrap = false
vim.opt.sidescroll = 5
vim.opt.sidescroll = 5
vim.opt.inccommand = "split"
vim.opt.lazyredraw = true
vim.opt.hidden = true
vim.opt.backup = false
vim.opt.writebackup = false
-- New dynamic window height
--vim.opt.cmdheight = 0
vim.opt.cmdheight = 1
-- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
-- delays and poor user experience.
--vim.opt.updatetime = 300
-- Don't pass messages to |ins-completion-menu|.
vim.opt.shortmess:append('c')
vim.opt.shortmess:remove('F')
vim.opt.signcolumn = "auto"
vim.opt.wildmode = "longest,list,full"
vim.opt.completeopt = "menu,menuone,noselect"
vim.opt.mouse = ""
--match Error /\s\+$\|DU\cPA/
vim.opt.virtualedit = "block"
vim.opt.shiftround = true
vim.opt.wildignorecase = true -- When set case is ignored when completing file names and directories
vim.opt.wildignore = [[
.git,.hg,.svn
*.aux,*.out,*.toc
*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
*.mp3,*.oga,*.ogg,*.wav,*.flac
*.eot,*.otf,*.ttf,*.woff
*.doc,*.pdf,*.cbr,*.cbz
*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
*.swp,.lock,.DS_Store,._*
*.log
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
]]

View File

@@ -0,0 +1,30 @@
local map = vim.keymap.set
local default_options = { silent = true }
local expr_options = { expr = true, silent = true }
-- space one line, home,end globally increase/decrease
map('n', '<Home>', 'zc', default_options)
map('n', '<End>', 'zo', default_options)
map('t', '<ESC><ESC>', '<C-\\><C-n>', default_options)
map('i', 'jj', '<ESC>', default_options)
map('i', 'jk', '<ESC>', default_options)
--map('i', ':w<CR>', '<Esc>:w<CR>', default_options)
map('n', 'Q', '<cmd>q', default_options)
-- Reselect visual block after incrementing/decrementing
map('v', '<c-a>', '<c-a>gv', default_options)
map('v', '<c-x>', '<c-x>gv', default_options)
map('n', '<leader>y', '"_y', default_options)
map('n', '<leader>d', '"_d', default_options)
map('v', '<leader>p', '"_p', default_options)
map("v", "p", '"_dp', default_options)
map("v", "P", '"_dP', default_options)
map('n', '<leader>2', '<esc>:set tabstop=2 softtabstop=2 shiftwidth=2<cr>', default_options)
map('n', '<leader>4', '<esc>:set tabstop=4 softtabstop=4 shiftwidth=4<cr>', default_options)
map('n', '<leader>8', '<esc>:set tabstop=8 softtabstop=8 shiftwidth=8<cr>', default_options)
map('n', '<leader><space>', '<cmd>nohlsearch<cr>', default_options)

View File

@@ -0,0 +1,24 @@
require("virt-column").setup { }
require('compiler-explorer').setup()
require("symbols-outline").setup()
require('pretty-fold').setup()
require('pretty-fold').ft_setup('cpp', {
process_comment_signs = false,
--comment_signs = {
-- '//', -- C++ Doxygen comments
--},
})
require('fold-preview').setup()
--require('lsp_lines').setup()
require('image').setup {
render = {
min_padding = 5,
show_label = true,
use_dither = true,
},
events = {
update_on_nvim_resize = true,
},
}