187 lines
4.9 KiB
VimL
187 lines
4.9 KiB
VimL
|
|
" ; '
|
|
" \\/\ \\ \\/\\/\\ ,._-_ _-_
|
|
" || | || || || || || ||
|
|
" || | || || || || || ||
|
|
" \\/ \\ \\ \\ \\ \\, \\,/
|
|
|
|
|
|
" 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
|
|
|
|
|
|
" Load plugins
|
|
call plug#begin('~/.vim/bundle')
|
|
|
|
Plug 'aliva/vim-fish', {'for': 'fish'}
|
|
Plug 'cocopon/iceberg.vim'
|
|
Plug 'dhruvasagar/vim-table-mode'
|
|
Plug 'fadein/vim-FIGlet'
|
|
Plug 'gkeep/iceberg-dark'
|
|
Plug 'itchyny/lightline.vim'
|
|
Plug 'karolbelina/uxntal.vim', {'for': 'uxntal'}
|
|
Plug 'lambdalisue/fern-git-status.vim'
|
|
Plug 'lambdalisue/fern-hijack.vim'
|
|
Plug 'lambdalisue/fern-renderer-nerdfont.vim'
|
|
Plug 'lambdalisue/fern.vim'
|
|
Plug 'lilydjwg/colorizer'
|
|
Plug 'mg979/vim-visual-multi'
|
|
Plug 'owickstrom/vim-colors-paramount'
|
|
Plug 'raimondi/delimitmate'
|
|
Plug 'tpope/vim-commentary'
|
|
Plug 'vim-scripts/nginx.vim', {'for': 'nginx'}
|
|
Plug 'yuttie/comfortable-motion.vim'
|
|
|
|
Plug 'lambdalisue/nerdfont.vim'
|
|
Plug 'ryanoasis/vim-devicons'
|
|
|
|
" don't install these plugins on remote servers
|
|
if has('nvim')
|
|
Plug 'airblade/vim-gitgutter'
|
|
Plug 'folke/todo-comments.nvim'
|
|
Plug 'hrsh7th/cmp-calc'
|
|
Plug 'j-hui/fidget.nvim'
|
|
Plug 'jghauser/mkdir.nvim'
|
|
Plug 'stevearc/dressing.nvim'
|
|
Plug 'williamboman/nvim-lsp-installer'
|
|
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
|
|
|
|
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>
|
|
|
|
" VM config
|
|
let g:VM_maps = {}
|
|
let g:VM_maps["I BS"] = '<c-BS>'
|
|
|
|
" 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
|
|
|
|
" Aliases
|
|
command Header FIGlet -f Gothic
|
|
cmap W w !sudo tee > /dev/null %
|
|
" nnoremap <C-e> :NERDTreeTabsToggle<CR>
|
|
nnoremap <C-e> :exec ':Fern -reveal=% -drawer -toggle -stay ' . FindSessionDirectory()<CR>
|
|
|
|
" Colorscheme
|
|
set background=dark
|
|
set termguicolors
|
|
colorscheme paramount
|
|
|
|
let bgcolor = synIDattr(hlID("Normal"), "bg")
|
|
let fgcolor = synIDattr(hlID("Identifier"), "fg")
|
|
let colors = "\033]11;" . fgcolor . "\007\033]11;" . bgcolor . "\007"
|
|
|
|
if has('gui_running') || has('nvim')
|
|
autocmd VimEnter * call chansend(v:stderr, colors)
|
|
autocmd VimLeave * call chansend(v:stderr, "\033]110\007\033]111\007")
|
|
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
|
|
let &t_ti = &t_ti . colors
|
|
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
|
|
set ts=4 sw=4
|
|
|
|
set autoindent
|
|
set smartindent
|
|
|
|
set laststatus=2
|
|
set noshowmode
|
|
set whichwrap+=<,>,h,l
|
|
|
|
let &t_SI = "\<Esc>[6 q"
|
|
" let &t_SR = "\<Esc>[4 q"
|
|
let &t_EI = "\<Esc>[2 q"
|
|
|
|
|
|
set clipboard=unnamedplus
|
|
nnoremap d "_d
|
|
vnoremap d "_d
|
|
|
|
set ignorecase
|
|
set smartcase
|
|
set hlsearch
|
|
let @/='' " fix search on startup
|
|
|
|
set encoding=utf-8
|
|
scriptencoding utf-8
|
|
setglobal fileencoding=utf-8
|
|
set ffs=unix,dos
|