rice/nvim/init.vim

262 lines
9.0 KiB
VimL
Raw Normal View History

2022-02-10 01:58:12 -08:00
syntax enable
filetype plugin on
2022-02-07 21:27:27 -08:00
set noshowmode "disable default vim insert text at bottom
set laststatus=2
set number
set colorcolumn=80
set tw=80
set shiftwidth=4
set tabstop=4
set autoindent
set ignorecase
set smartcase
set incsearch
set smartindent
set hlsearch
set ignorecase
set noerrorbells
set title
set mouse=a
set relativenumber
set splitright
set cursorline
set scrolloff=8
set sidescrolloff=8
set wildmenu " show candidates for vim commands with tab
set wildignore=*.o,*.obj,*.bak,*.exe
set background=dark
set showmatch
set nocompatible " no more vi
set list
set listchars=tab:\ ,trail:
" set path from current directory and all directories under
set path=$PWD/**
set encoding=UTF-8
set guifont=FiraCode\ Nerd\ Font\ 18
set expandtab
" coc settings
set hidden
set nobackup
set nowritebackup
set cmdheight=2
set updatetime=300
2022-02-09 01:25:05 -08:00
set timeoutlen=400
2022-02-07 21:27:27 -08:00
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" Install vim-plug if not found
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
2022-02-09 01:25:05 -08:00
\| endif
2022-02-07 21:27:27 -08:00
call plug#begin('~/.vim/plugged')
2022-02-10 23:02:09 -08:00
Plug 'ap/vim-css-color'
Plug 'github/copilot.vim'
Plug 'jiangmiao/auto-pairs'
2022-02-07 21:27:27 -08:00
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'osyo-manga/vim-over'
2022-02-10 23:02:09 -08:00
Plug 'pechorin/any-jump.vim'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'voldikss/vim-floaterm'
Plug 'wakatime/vim-wakatime'
2022-02-07 21:27:27 -08:00
2022-02-10 00:43:30 -08:00
" Plug 'dense-analysis/ale'
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
2022-02-10 23:02:09 -08:00
let g:mapleader = "\<Space>"
let g:maplocalleader = ','
2022-02-07 21:27:27 -08:00
if has('nvim')
2022-02-10 23:02:09 -08:00
Plug 'nvim-lua/plenary.nvim'
" Plug 'TimUntersberger/neogit'
2022-02-07 21:27:27 -08:00
Plug 'akinsho/bufferline.nvim'
2022-02-10 23:02:09 -08:00
Plug 'f-person/git-blame.nvim'
2022-02-08 01:21:19 -08:00
Plug 'folke/which-key.nvim'
Plug 'glepnir/dashboard-nvim'
Plug 'kyazdani42/nvim-tree.lua'
2022-02-10 23:02:09 -08:00
Plug 'kyazdani42/nvim-web-devicons'
Plug 'lewis6991/gitsigns.nvim'
Plug 'lewis6991/gitsigns.nvim'
Plug 'nvim-lualine/lualine.nvim'
2022-02-08 15:24:33 -08:00
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
2022-02-10 16:56:49 -08:00
Plug 'ojroques/nvim-lspfuzzy'
2022-02-07 21:27:27 -08:00
2022-02-10 23:02:09 -08:00
Plug 'L3MON4D3/LuaSnip'
Plug 'folke/trouble.nvim'
2022-02-10 00:43:30 -08:00
Plug 'hrsh7th/cmp-buffer'
2022-02-10 23:02:09 -08:00
Plug 'hrsh7th/cmp-nvim-lsp'
2022-02-10 00:43:30 -08:00
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/nvim-cmp'
2022-02-10 23:02:09 -08:00
Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'neovim/nvim-lspconfig'
2022-02-10 00:43:30 -08:00
Plug 'onsails/lspkind-nvim'
2022-02-10 23:02:09 -08:00
Plug 'ray-x/lsp_signature.nvim'
2022-02-10 16:56:49 -08:00
Plug 'rmagatti/goto-preview',
2022-02-10 23:02:09 -08:00
Plug 'saadparwaiz1/cmp_luasnip'
Plug 'simrat39/symbols-outline.nvim'
Plug 'williamboman/nvim-lsp-installer'
2022-02-09 01:25:05 -08:00
2022-02-07 21:27:27 -08:00
Plug 'Mofiqul/dracula.nvim'
2022-02-10 23:02:09 -08:00
Plug 'NTBBloodbath/doom-one.nvim'
Plug 'olimorris/onedarkpro.nvim'
2022-02-07 21:27:27 -08:00
Plug 'projekt0n/github-nvim-theme'
else
Plug 'ap/vim-buftabline'
2022-02-10 16:56:49 -08:00
Plug 'itchyny/lightline.vim'
2022-02-10 23:02:09 -08:00
Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] }
2022-02-10 16:56:49 -08:00
Plug 'maximbaz/lightline-ale'
2022-02-10 23:02:09 -08:00
Plug 'mhinz/vim-startify'
Plug 'preservim/nerdtree' | Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'ryanoasis/vim-devicons'
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-fugitive'
2022-02-09 01:25:05 -08:00
2022-02-07 21:27:27 -08:00
Plug 'joshdick/onedark.vim'
Plug 'kaicataldo/material.vim', { 'branch': 'main' }
Plug 'morhetz/gruvbox'
Plug 'vv9k/vim-github-dark'
endif
call plug#end()
if has('nvim')
2022-02-10 23:02:09 -08:00
set completeopt=menu,menuone,noselect
source ~/.config/nvim/keybindings.vim
2022-02-09 01:25:05 -08:00
source ~/.config/nvim/plugin-confs/bufferline.lua
source ~/.config/nvim/plugin-confs/dashboard-art.vim
2022-02-10 23:02:09 -08:00
source ~/.config/nvim/plugin-confs/dashboard-nvim.lua
source ~/.config/nvim/plugin-confs/git-blame.lua
source ~/.config/nvim/plugin-confs/gitsigns.lua
2022-02-10 16:56:49 -08:00
source ~/.config/nvim/plugin-confs/lspfuzzy.lua
source ~/.config/nvim/plugin-confs/lualine.lua
2022-02-10 23:02:09 -08:00
" source ~/.config/nvim/plugin-confs/neogit.lua
source ~/.config/nvim/plugin-confs/nvimtree.lua
source ~/.config/nvim/plugin-confs/treesitter.lua
source ~/.config/nvim/plugin-confs/whichkey.lua
2022-02-09 01:25:05 -08:00
2022-02-10 16:56:49 -08:00
source ~/.config/nvim/plugin-confs/code_actions.lua
2022-02-10 23:02:09 -08:00
source ~/.config/nvim/plugin-confs/goto-preview.lua
source ~/.config/nvim/plugin-confs/lsp-kind.lua
2022-02-09 01:25:05 -08:00
source ~/.config/nvim/plugin-confs/lsp-signature.lua
2022-02-10 23:02:09 -08:00
source ~/.config/nvim/plugin-confs/lspconfig.lua
2022-02-10 00:43:30 -08:00
source ~/.config/nvim/plugin-confs/null-ls.lua
source ~/.config/nvim/plugin-confs/nvim-cmp.lua
2022-02-10 23:02:09 -08:00
source ~/.config/nvim/plugin-confs/symbols-outline.lua
2022-02-10 16:56:49 -08:00
source ~/.config/nvim/plugin-confs/trouble.lua
2022-02-09 01:25:05 -08:00
2022-02-10 23:02:09 -08:00
source ~/.vim/plugin-confs/floaterm.vim
2022-02-09 01:25:05 -08:00
source ~/.vim/plugin-confs/fzf.vim
2022-02-10 23:02:09 -08:00
source ~/.vim/plugin-confs/lightline.vim
2022-02-09 01:25:05 -08:00
source ~/.vim/plugin-confs/vim-closetag.vim
source ~/.vim/plugin-confs/wakatime.vim
source ~/.config/nvim/plugin-confs/doomone.lua
source ~/.config/nvim/plugin-confs/dracula.lua
source ~/.config/nvim/plugin-confs/github-theme.lua
2022-02-10 16:56:49 -08:00
source ~/.config/nvim/plugin-confs/onedarkpro.lua
2022-02-07 21:27:27 -08:00
" makes fzf match colorscheme (I think)
augroup fzf_preview
autocmd!
autocmd User fzf_preview#rpc#initialized call s:fzf_preview_settings() " fzf_preview#remote#initialized or fzf_preview#coc#initialized
augroup END
function! s:fzf_preview_settings() abort
let g:fzf_preview_command = 'COLORTERM=truecolor ' . g:fzf_preview_command
let g:fzf_preview_grep_preview_cmd = 'COLORTERM=truecolor ' . g:fzf_preview_grep_preview_cmd
endfunction
" make terminal not have line numbers
autocmd TermOpen * setlocal nonumber norelativenumber
2022-02-09 01:25:05 -08:00
2022-02-08 01:21:19 -08:00
else
2022-02-10 23:02:09 -08:00
source ~/.vim/keybindings.vim
2022-02-09 01:25:05 -08:00
source ~/.vim/plugin-confs/nerdtree.vim
source ~/.vim/plugin-confs/whichkey.vim
source ~/.vim/plugin-confs/ale.vim
source ~/.vim/plugin-confs/fzf.vim
source ~/.vim/plugin-confs/vim-closetag.vim
source ~/.vim/plugin-confs/wakatime.vim
source ~/.vim/plugin-confs/prettier.vim
source ~/.vim/plugin-confs/lightline.vim
source ~/.vim/plugin-confs/coc.vim
source ~/.vim/plugin-confs/floaterm.vim
if executable('bash-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'bash-language-server',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'bash-language-server start']},
\ 'allowlist': ['sh'],
\ })
endif
2022-02-07 21:27:27 -08:00
endif
"------------------------------------------------------------------------------
" Enable :Man <man_page>
"------------------------------------------------------------------------------
runtime ftplugin/man.vim
"------------------------------------------------------------------------------
" Force help/man buffers into vertical split
"------------------------------------------------------------------------------
autocmd FileType help wincmd L
autocmd FileType man wincmd L
"------------------------------------------------------------------------------
"jump to remembered position in file if available
"------------------------------------------------------------------------------
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
endif
"------------------------------------------------------------------------------
"COLORSCHEME
"------------------------------------------------------------------------------
set t_Co=256
if has('nvim')
set termguicolors
" colorscheme doom-one
" colorscheme dracula
colorscheme github_dark
else
" let g:onedark_termcolors=256 "enable 256 colors
" colorscheme onedark "set colorsheme as onedark
"material theme
" let g:material_theme_style = 'default' | 'palenight' | 'ocean' | 'lighter' | 'darker' | 'default-community' | 'palenight-community' | 'ocean-community' | 'lighter-community' | 'darker-community'
" let g:material_terminal_italics = 1
" let g:material_theme_style = 'darker'
" colorscheme material
let g:gruvbox_contrast_dark = "medium" "default
" let g:gruvbox_contrast_dark = "soft"
let g:gruvbox_improved_strings = 0
let g:gruvbox_improved_warnings = 1
colorscheme gruvbox
endif
"------------------------------------------------------------------------------
" custom commands
"------------------------------------------------------------------------------
2022-02-09 01:25:05 -08:00
command! -bang -nargs=? -complete=dir Files
2022-02-10 23:02:09 -08:00
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), <bang>0)
2022-02-09 01:25:05 -08:00
command! -bang -nargs=? -complete=dir AllFiles
2022-02-10 23:02:09 -08:00
\ call fzf#run(fzf#wrap('allfiles', fzf#vim#with_preview({'dir': <q-args>, 'sink': 'e', 'source': 'rg --files --hidden --no-ignore', 'options': ['--layout=reverse', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), <bang>0))
command! Lines call fzf#vim#lines(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse']}), <bang>0)
command! -bang -nargs=? -complete=dir Buffers
\ call fzf#vim#buffers(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), <bang>0)
2022-02-07 21:27:27 -08:00
command! Reload execute "source ~/.vimrc"
command! Config execute ":e ~/.vimrc"
command! Env execute ":Dotenv .env"
command! MakeTags !ctags -R .
command! Ovewrite execute ":w !sudo tee %"
command! Aniwrapper execute ":FloatermNew aniwrapper -qtdoomone -D 144"