vim and nvim config refactor / update
This commit is contained in:
parent
a5827a87a2
commit
aeb129a621
3 changed files with 81 additions and 121 deletions
|
@ -1,36 +1,40 @@
|
||||||
require('paq') {
|
local ensure_packer = function()
|
||||||
'savq/paq-nvim',
|
local install_path = vim.fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||||
|
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||||
|
vim.fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||||
|
vim.cmd [[packadd packer.nvim]]
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
'mhinz/vim-signify',
|
local packer_bootstrap = ensure_packer()
|
||||||
'tpope/vim-commentary',
|
|
||||||
'tpope/vim-fugitive',
|
require('packer').startup(function(use)
|
||||||
'tpope/vim-rsi',
|
use 'wbthomason/packer.nvim'
|
||||||
'tpope/vim-vinegar',
|
use 'lifepillar/vim-gruvbox8'
|
||||||
'hoob3rt/lualine.nvim',
|
|
||||||
|
use 'mhinz/vim-signify'
|
||||||
|
use 'tpope/vim-fugitive'
|
||||||
|
use 'tpope/vim-rsi'
|
||||||
|
use 'tpope/vim-vinegar'
|
||||||
|
use 'hoob3rt/lualine.nvim'
|
||||||
|
use {
|
||||||
'w0rp/ale',
|
'w0rp/ale',
|
||||||
|
ft = { 'sh', 'zsh', 'lua', 'python' },
|
||||||
'lifepillar/vim-gruvbox8',
|
cmd = 'ALEEnable'
|
||||||
'lifepillar/vim-solarized8',
|
|
||||||
'NLKNguyen/papercolor-theme'
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lualine').setup{
|
|
||||||
options = {
|
|
||||||
icons_enabled = false,
|
|
||||||
section_separators = { left = '', right = ''},
|
|
||||||
component_separators = { left = '', right = ''}
|
|
||||||
}
|
}
|
||||||
}
|
end)
|
||||||
|
|
||||||
vim.g.vimwiki_list = {{path='$HOME/vimwiki/', syntax='markdown', ext='.md'}}
|
if packer_bootstrap then
|
||||||
vim.g.PaperColor_Theme_Options = {
|
require('packer').sync()
|
||||||
theme = {
|
return
|
||||||
["default.dark"] = { allow_bold = 1, allow_italic = 1 },
|
end
|
||||||
["default.light"] = { allow_bold = 1, allow_italic = 1 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
require('lualine').setup { options = { icons_enabled = false } }
|
||||||
vim.o.bg = 'dark'
|
vim.o.bg = 'dark'
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
vim.g.gruvbox_transp_bg = 1
|
||||||
|
vim.g.gruvbox_plugin_hi_groups = 1
|
||||||
vim.g.gruvbox_filetype_hi_groups = 1
|
vim.g.gruvbox_filetype_hi_groups = 1
|
||||||
vim.cmd('colorscheme gruvbox8')
|
vim.cmd('colorscheme gruvbox8')
|
||||||
|
|
98
vimplugrc
98
vimplugrc
|
@ -1,49 +1,11 @@
|
||||||
" support my own way of using plugins in vim / bash
|
vim9script
|
||||||
autocmd BufRead *vimplugrc set ft=vim
|
autocmd BufRead *vimplugrc set ft=vim
|
||||||
|
|
||||||
let theme = 'gruvbox8'
|
execute 'source' fnameescape(g:plug)
|
||||||
let themebg = 'dark'
|
plug#begin(g:plugdir)
|
||||||
let lightline_theme = printf(theme)
|
|
||||||
|
|
||||||
function EnableTGC()
|
|
||||||
let &t_8f = "\u1b[38;2;%lu;%lu;%lum"
|
|
||||||
let &t_8b = "\u1b[48;2;%lu;%lu;%lum"
|
|
||||||
let &tgc = 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if theme == 'PaperColor'
|
|
||||||
let g:PaperColor_Theme_Options = {'theme': {
|
|
||||||
\ 'default.dark': {'allow_bold': 1, 'allow_italic': 1},
|
|
||||||
\ 'default.light': {'allow_bold': 1, 'allow_italic': 1}
|
|
||||||
\ }}
|
|
||||||
endif
|
|
||||||
|
|
||||||
if theme == 'gruvbox8'
|
|
||||||
call EnableTGC()
|
|
||||||
let g:gruvbox_transp_bg = 1
|
|
||||||
let g:gruvbox_plugin_hi_groups = 1
|
|
||||||
let g:gruvbox_filetype_hi_groups = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
if theme == 'solarized8'
|
|
||||||
let lightline_theme = 'solarized'
|
|
||||||
|
|
||||||
let g:solarized_use16 = 1
|
|
||||||
let g:solarized_italics = 1
|
|
||||||
let g:solarized_extra_hi_groups = 1
|
|
||||||
let g:solarized_termtrans = 1
|
|
||||||
let g:solarized_termcolors = 16
|
|
||||||
endif
|
|
||||||
|
|
||||||
" enable plugins
|
|
||||||
execute 'source' fnameescape(plug)
|
|
||||||
silent!call plug#begin(plugdir)
|
|
||||||
|
|
||||||
" plugin manager for self updates
|
|
||||||
Plug 'junegunn/vim-plug'
|
Plug 'junegunn/vim-plug'
|
||||||
|
Plug 'lifepillar/vim-gruvbox8'
|
||||||
|
|
||||||
" general plugins
|
|
||||||
"Plug 'sheerun/vim-polyglot'
|
|
||||||
Plug 'hashivim/vim-terraform'
|
Plug 'hashivim/vim-terraform'
|
||||||
Plug 'itchyny/lightline.vim'
|
Plug 'itchyny/lightline.vim'
|
||||||
Plug 'junegunn/fzf'
|
Plug 'junegunn/fzf'
|
||||||
|
@ -55,49 +17,43 @@ Plug 'tpope/vim-fugitive'
|
||||||
Plug 'tpope/vim-rsi'
|
Plug 'tpope/vim-rsi'
|
||||||
Plug 'tpope/vim-vinegar'
|
Plug 'tpope/vim-vinegar'
|
||||||
Plug 'w0rp/ale', {'for': ['sh']}
|
Plug 'w0rp/ale', {'for': ['sh']}
|
||||||
Plug 'vimwiki/vimwiki', {'on': 'VimwikiIndex'}
|
plug#end()
|
||||||
|
|
||||||
" themes
|
# easy-align
|
||||||
Plug 'lifepillar/vim-gruvbox8'
|
|
||||||
Plug 'lifepillar/vim-solarized8'
|
|
||||||
Plug 'NLKNguyen/papercolor-theme'
|
|
||||||
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" easy-align
|
|
||||||
xmap <Leader>a <Plug>(EasyAlign)
|
xmap <Leader>a <Plug>(EasyAlign)
|
||||||
nmap <Leader>a <Plug>(EasyAlign)
|
nmap <Leader>a <Plug>(EasyAlign)
|
||||||
|
|
||||||
" fzf
|
# fzf
|
||||||
nmap <Leader>ff :Files<CR>
|
nmap <Leader>ff :Files<CR>
|
||||||
nmap <Leader>fg :GFiles<CR>
|
nmap <Leader>fg :GFiles<CR>
|
||||||
nmap <Leader>fb :Buffers<CR>
|
nmap <Leader>fb :Buffers<CR>
|
||||||
nmap <Leader>fl :Lines<CR>
|
nmap <Leader>fl :Lines<CR>
|
||||||
nmap <Leader>ft :Filetypes<CR>
|
nmap <Leader>ft :Filetypes<CR>
|
||||||
|
|
||||||
" vimwiki
|
# lightline
|
||||||
let g:vimwiki_list = [{'path': '$HOME/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}]
|
g:lightline = {
|
||||||
|
colorscheme: 'gruvbox8',
|
||||||
|
separator: { left: "\ue0b0", right: "\ue0b2"},
|
||||||
|
subseparator: { left: "\ue0b1", right: "\ue0b3"}
|
||||||
|
}
|
||||||
|
|
||||||
" lightline
|
if $TERM == 'xterm-256color'
|
||||||
let g:lightline = {
|
|
||||||
\ 'separator': {'left': "\ue0b0", 'right': "\ue0b2"},
|
|
||||||
\ 'subseparator': {'left': "\ue0b1", 'right': "\ue0b3"}
|
|
||||||
\ }
|
|
||||||
let g:lightline['colorscheme'] = printf(lightline_theme)
|
|
||||||
|
|
||||||
if $TERM !~ '^linux'
|
|
||||||
if $TERM == 'xterm-256color'
|
|
||||||
set term=xterm-direct
|
set term=xterm-direct
|
||||||
endif
|
endif
|
||||||
if has('gui_running')
|
|
||||||
set guifont=Cascadia\ Code\ PL:h16
|
g:gruvbox_transp_bg = 1
|
||||||
|
g:gruvbox_plugin_hi_groups = 1
|
||||||
|
g:gruvbox_filetype_hi_groups = 1
|
||||||
|
&t_8f = "\u1b[38;2;%lu;%lu;%lum"
|
||||||
|
&t_8b = "\u1b[48;2;%lu;%lu;%lum"
|
||||||
|
&tgc = 1
|
||||||
|
&bg = 'dark'
|
||||||
|
colorscheme gruvbox8
|
||||||
|
|
||||||
|
if has('gui_running')
|
||||||
|
set guifont=JetBrains\ Mono:h14
|
||||||
set guicursor=a:blinkon0,a:block,i:ver1-Cursor/lCursor,r:hor1-Cursor/lCursor
|
set guicursor=a:blinkon0,a:block,i:ver1-Cursor/lCursor,r:hor1-Cursor/lCursor
|
||||||
set guiheadroom=0 guioptions=aei mouse=a
|
set guiheadroom=0 guioptions=aei mouse=a
|
||||||
|
|
||||||
map <S-Insert> <MiddleMouse>
|
map <S-Insert> <MiddleMouse>
|
||||||
map! <S-Insert> <MiddleMouse>
|
map! <S-Insert> <MiddleMouse>
|
||||||
endif
|
|
||||||
|
|
||||||
let &bg = printf(themebg)
|
|
||||||
execute printf('colorscheme %s', theme)
|
|
||||||
endif
|
endif
|
||||||
|
|
28
vimrc
28
vimrc
|
@ -1,3 +1,4 @@
|
||||||
|
vim9script
|
||||||
set nobackup nomodeline backspace=indent,eol,start foldmethod=marker cursorline
|
set nobackup nomodeline backspace=indent,eol,start foldmethod=marker cursorline
|
||||||
set list listchars=tab:-->,nbsp:x,trail:*
|
set list listchars=tab:-->,nbsp:x,trail:*
|
||||||
set hlsearch incsearch ignorecase smartcase
|
set hlsearch incsearch ignorecase smartcase
|
||||||
|
@ -6,32 +7,31 @@ set tabstop=3 softtabstop=4 shiftwidth=4 smarttab expandtab autoindent
|
||||||
set wildmenu showcmd ruler laststatus=2 mouse= t_ut= guicursor= t_Co=256
|
set wildmenu showcmd ruler laststatus=2 mouse= t_ut= guicursor= t_Co=256
|
||||||
set belloff=all colorcolumn=80 formatoptions+=j relativenumber breakindent
|
set belloff=all colorcolumn=80 formatoptions+=j relativenumber breakindent
|
||||||
set keymap=russian-jcukenwintype iminsert=0 imsearch=0
|
set keymap=russian-jcukenwintype iminsert=0 imsearch=0
|
||||||
let &statusline="[%F] %R%H%W%M %=[%{&fenc}/%{&ff}] %y [%4l/%L:%3v]"
|
&statusline = "[%F] %R%H%W%M %=[%{&fenc}/%{&ff}] %y [%4l/%L:%3v]"
|
||||||
let g:sh_indent_case_labels = 1
|
g:sh_indent_case_labels = 1
|
||||||
|
|
||||||
" mappings
|
# mappings
|
||||||
map <Space> <NOP>
|
map <Space> <NOP>
|
||||||
let mapleader="\<Space>"
|
var mapleader = '\<Space>'
|
||||||
noremap <F1> <Esc>
|
noremap <F1> <Esc>
|
||||||
noremap! <F1> <Esc>
|
|
||||||
nnoremap <Leader>l :setlocal list!<CR>
|
|
||||||
nnoremap <Leader>c :setlocal cursorline!<CR>
|
|
||||||
nnoremap <Leader>w :setlocal wrap!<CR>
|
|
||||||
noremap <Leader>/ :noh<CR>
|
noremap <Leader>/ :noh<CR>
|
||||||
noremap <Leader>y "+y
|
noremap <Leader>y "+y
|
||||||
noremap <Leader>d "+d
|
noremap <Leader>d "+d
|
||||||
noremap <Leader>p "+p
|
noremap <Leader>p "+p
|
||||||
noremap <Leader>P "+P
|
noremap <Leader>P "+P
|
||||||
noremap q <NOP>
|
noremap q <NOP>
|
||||||
|
noremap! <F1> <Esc>
|
||||||
noremap! <C-@> <C-^>
|
noremap! <C-@> <C-^>
|
||||||
noremap! <C-Space> <C-^>
|
noremap! <C-Space> <C-^>
|
||||||
|
nnoremap <Leader>l :setlocal list!<CR>
|
||||||
|
nnoremap <Leader>c :setlocal cursorline!<CR>
|
||||||
|
nnoremap <Leader>w :setlocal wrap!<CR>
|
||||||
|
|
||||||
" plugins
|
g:plugrc = expand('$HOME/.vimplugrc')
|
||||||
let plugrc = expand('$HOME/.vimplugrc')
|
g:plugdir = expand('$HOME/.vim/plugged')
|
||||||
let plugdir = expand('$HOME/.vim/plugged')
|
g:plug = g:plugdir .. '/vim-plug/plug.vim'
|
||||||
let plug = plugdir . '/vim-plug/plug.vim'
|
if filereadable(g:plugrc) && filereadable(g:plug) && v:version >= 703
|
||||||
if filereadable(plugrc) && filereadable(plug) && v:version >= 703
|
execute 'source' fnameescape(g:plugrc)
|
||||||
execute 'source' fnameescape(plugrc)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syntax on
|
syntax on
|
||||||
|
|
Loading…
Reference in a new issue