dotfiles/.vimrc

187 lines
4.9 KiB
VimL
Raw Normal View History

2022-01-22 22:55:38 +00:00
2022-06-21 19:04:29 +00:00
" ; '
" \\/\ \\ \\/\\/\\ ,._-_ _-_
" || | || || || || || ||
" || | || || || || || ||
" \\/ \\ \\ \\ \\ \\, \\,/
2022-06-23 08:07:54 +00:00
2022-06-21 19:04:29 +00:00
" Install VimPlug
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
2022-01-22 22:55:38 +00:00
" Load plugins
call plug#begin('~/.vim/bundle')
2022-05-11 14:14:46 +00:00
Plug 'aliva/vim-fish', {'for': 'fish'}
2022-01-22 22:55:38 +00:00
Plug 'cocopon/iceberg.vim'
2022-02-16 00:17:42 +00:00
Plug 'dhruvasagar/vim-table-mode'
2022-01-22 22:55:38 +00:00
Plug 'fadein/vim-FIGlet'
Plug 'gkeep/iceberg-dark'
Plug 'itchyny/lightline.vim'
2022-05-11 14:14:46 +00:00
Plug 'karolbelina/uxntal.vim', {'for': 'uxntal'}
2022-06-23 08:07:54 +00:00
Plug 'lambdalisue/fern-git-status.vim'
Plug 'lambdalisue/fern-hijack.vim'
Plug 'lambdalisue/fern-renderer-nerdfont.vim'
Plug 'lambdalisue/fern.vim'
2022-01-22 22:55:38 +00:00
Plug 'lilydjwg/colorizer'
2022-05-11 14:14:46 +00:00
Plug 'mg979/vim-visual-multi'
2022-01-22 22:55:38 +00:00
Plug 'owickstrom/vim-colors-paramount'
2022-05-11 14:14:46 +00:00
Plug 'raimondi/delimitmate'
2022-01-22 22:55:38 +00:00
Plug 'tpope/vim-commentary'
2022-05-11 14:14:46 +00:00
Plug 'vim-scripts/nginx.vim', {'for': 'nginx'}
2022-01-22 22:55:38 +00:00
Plug 'yuttie/comfortable-motion.vim'
2022-06-21 19:04:29 +00:00
2022-06-23 08:07:54 +00:00
Plug 'lambdalisue/nerdfont.vim'
2022-05-11 14:14:46 +00:00
Plug 'ryanoasis/vim-devicons'
" don't install these plugins on remote servers
if has('nvim')
2022-06-23 08:07:54 +00:00
Plug 'airblade/vim-gitgutter'
2022-05-11 14:14:46 +00:00
Plug 'folke/todo-comments.nvim'
Plug 'hrsh7th/cmp-calc'
Plug 'j-hui/fidget.nvim'
Plug 'jghauser/mkdir.nvim'
Plug 'stevearc/dressing.nvim'
2022-06-23 08:07:54 +00:00
Plug 'williamboman/nvim-lsp-installer'
2022-05-11 14:14:46 +00:00
Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'edluffy/specs.nvim'
Plug 'folke/lsp-colors.nvim'
Plug 'folke/trouble.nvim'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/vim-vsnip'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'maximbaz/lightline-ale'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'tpope/vim-fugitive'
Plug 'w0rp/ale'
endif
2022-06-21 19:04:29 +00:00
2022-01-22 22:55:38 +00:00
call plug#end()
" Lightline config
let g:lightline = {
\ 'colorscheme': 'icebergDark',
\ }
" Comfortable Motion config
noremap <silent> <ScrollWheelDown> :call comfortable_motion#flick(20)<CR>
noremap <silent> <ScrollWheelUp> :call comfortable_motion#flick(-20)<CR>
2022-05-11 14:14:46 +00:00
" VM config
let g:VM_maps = {}
let g:VM_maps["I BS"] = '<c-BS>'
2022-01-22 22:55:38 +00:00
2022-06-23 08:07:54 +00:00
" Fern config
let g:fern#renderer = "nerdfont"
function FindSessionDirectory() abort
if len(argv()) > 0
return fnamemodify(argv()[0], ':p:h')
endif
return getcwd()
endfunction!
function! s:init_fern() abort
nmap <buffer><expr>
\ <Plug>(fern-my-expand-or-collapse)
\ fern#smart#leaf(
\ "\<Plug>(fern-action-open)",
\ "\<Plug>(fern-action-expand)",
\ "\<Plug>(fern-action-collapse)",
\ )
" Define NERDTree like mappings
nmap <buffer> t <Plug>(fern-action-open:tabedit)
nmap <buffer> T <Plug>(fern-action-open:tabedit)gT
nmap <buffer> i <Plug>(fern-action-open:split)
nmap <buffer> gi <Plug>(fern-action-open:split)<C-w>p
nmap <buffer> s <Plug>(fern-action-open:vsplit)
nmap <buffer> gs <Plug>(fern-action-open:vsplit)<C-w>p
nmap <buffer> ma <Plug>(fern-action-new-path)
nmap <buffer> <CR> <Plug>(fern-my-expand-or-collapse)
nmap <buffer> P gg
endfunction
augroup my-fern-startup
autocmd! *
autocmd FileType fern call s:init_fern()
if has('nvim')
autocmd TabNewEntered * ++nested exec 'Fern -reveal=% -drawer -stay ' . FindSessionDirectory()
endif
augroup END
2022-05-11 14:14:46 +00:00
2022-06-21 19:04:29 +00:00
" Aliases
2022-01-22 22:55:38 +00:00
command Header FIGlet -f Gothic
2022-04-09 16:34:56 +00:00
cmap W w !sudo tee > /dev/null %
2022-06-23 08:07:54 +00:00
" nnoremap <C-e> :NERDTreeTabsToggle<CR>
nnoremap <C-e> :exec ':Fern -reveal=% -drawer -toggle -stay ' . FindSessionDirectory()<CR>
2022-06-21 19:04:29 +00:00
2022-01-22 22:55:38 +00:00
" Colorscheme
set background=dark
set termguicolors
colorscheme paramount
let bgcolor = synIDattr(hlID("Normal"), "bg")
let fgcolor = synIDattr(hlID("Identifier"), "fg")
2022-05-11 14:14:46 +00:00
let colors = "\033]11;" . fgcolor . "\007\033]11;" . bgcolor . "\007"
2022-01-22 22:55:38 +00:00
2022-06-21 19:04:29 +00:00
if has('gui_running') || has('nvim')
2022-05-11 14:14:46 +00:00
autocmd VimEnter * call chansend(v:stderr, colors)
autocmd VimLeave * call chansend(v:stderr, "\033]110\007\033]111\007")
2022-01-22 22:55:38 +00:00
else
" Set the terminal default background and foreground colors, thereby
" improving performance by not needing to set these colors on empty cells.
hi Normal guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE
2022-05-11 14:14:46 +00:00
let &t_ti = &t_ti . colors
2022-01-22 22:55:38 +00:00
let &t_te = &t_te . "\033]110\007\033]111\007"
endif
" Vanilla config
syntax on
filetype plugin indent on
set number
set wrap
set mouse=a
set softtabstop=4 noexpandtab
2022-05-11 14:14:46 +00:00
set ts=4 sw=4
set autoindent
set smartindent
2022-01-22 22:55:38 +00:00
2022-04-09 16:42:05 +00:00
set laststatus=2
set noshowmode
2022-04-09 16:34:56 +00:00
set whichwrap+=<,>,h,l
2022-05-11 14:14:46 +00:00
let &t_SI = "\<Esc>[6 q"
2022-04-09 16:34:56 +00:00
" let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"
2022-01-22 22:55:38 +00:00
set clipboard=unnamedplus
2022-04-09 16:34:56 +00:00
nnoremap d "_d
vnoremap d "_d
2022-05-11 14:14:46 +00:00
set ignorecase
set smartcase
2022-01-22 22:55:38 +00:00
set hlsearch
2022-05-11 14:14:46 +00:00
let @/='' " fix search on startup
2022-01-22 22:55:38 +00:00
set encoding=utf-8
scriptencoding utf-8
setglobal fileencoding=utf-8
2022-05-11 14:14:46 +00:00
set ffs=unix,dos