"################################################# "# Vim Plug "################################################## call plug#begin() " QOL Plug 'airblade/vim-rooter' Plug 'w0rp/ale' Plug 'yuttie/comfortable-motion.vim' Plug 'tpope/vim-surround' Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} " Fzf Plug 'junegunn/fzf' Plug 'junegunn/fzf.vim' " Git plugin Plug 'tpope/vim-fugitive' " GUI Stuff Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Plug 'edkolev/tmuxline.vim' Plug 'tpope/vim-commentary' Plug 'uttarayan21/minimalist' " Plug 'dikiaap/minimalist' Plug 'dracula/vim' Plug 'tpope/vim-vinegar' Plug 'mhinz/vim-crates' " Intellisense Plug 'neoclide/coc.nvim', {'branch': 'release'} " Ctags Plug 'ludovicchabant/vim-gutentags' Plug 'majutsushi/tagbar' " Syntax Highlighting Plug 'rust-lang/rust.vim' Plug 'sudar/vim-arduino-syntax' Plug 'cespare/vim-toml' Plug 'chaimleib/vim-renpy' Plug 'udalov/kotlin-vim' Plug 'meain/vim-package-info' " Devicons Plug 'ryanoasis/vim-devicons' " Text Objects Plug 'wellle/targets.vim' call plug#end() "################################################## "# Configurations "################################################## " Remap C-h,j,k,l "nnoremap h "nnoremap j "nnoremap k "nnoremap l " nnoremap inoremap let mapleader = "\" " BufferNext nnoremap q :bw "nnoremap :bNext nnoremap nnoremap n :bnext nnoremap p :bprev " Fzf nnoremap f :Files nnoremap b :Buffers nnoremap w :W nnoremap g :Rg nnoremap t :Tags nnoremap :TagbarToggle " Vim hardmode inoremap inoremap inoremap inoremap nnoremap nnoremap nnoremap nnoremap " Undo set undodir=~/.cache/nvim/nvimdid set undofile " Disable help on F1 nnoremap inoremap " Ctags let g:gutentags_cache_dir = expand('~/.cache/nvim/ctags/') let g:gutentags_generate_on_new = 1 let g:gutentags_generate_on_missing = 1 let g:gutentags_generate_on_write = 1 let g:gutentags_generate_on_empty_buffer = 0 nnoremap nnoremap " Markdown Preview " let g:mkdp_auto_start = 1 let g:mkdp_filetypes = ['markdown'] " let g:mkdp_broswer = 'qutebrowser' " Numbers and tabs set noshowmode set showtabline=2 setlocal number relativenumber set autoindent set tabstop=4 set shiftwidth=4 set expandtab set signcolumn=yes set hidden set ignorecase set smartcase "set cmdheight=2 nnoremap :set number! relativenumber! "A few more remaps nnoremap :source ~/.config/nvim/init.vim nnoremap m :call Mpcfzf() " Intellisense " Use tab for trigger completion with characters ahead and navigate. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" inoremap coc#refresh() nnoremap K :call show_documentation() nnoremap l :CocCommand " Clipboard set clipboard=unnamedplus let g:clipboard = { \'name': 'PrimaryClipboard', \'copy': { \ '+': 'xclip -selection clipboard', \ '*': 'xclip -selection clipboard', \ }, \'paste': { \ '+': 'xclip -selection clipboard -out', \ '*': 'xclip -selection clipboard -out', \ }, \'cache_enabled': 1, \} augroup linenumbers autocmd WinLeave * :setlocal nonumber norelativenumber autocmd WinEnter * :setlocal number relativenumber augroup END " Do not edit readonly buffers autocmd BufRead *.orig set readonly autocmd BufRead *.pacnew set readonly autocmd BufRead *.bak set readonly autocmd BufWritePost *sxhkdrc !pkill -USR1 sxhkd autocmd FileType netrw setl bufhidden=wipe let g:netrw_fastbrowse = 0 " Toggle crates plugin on opening cargo.toml file autocmd BufRead Cargo.toml call crates#toggle() " Set python global file let g:python3_host_prog = "/usr/bin/python" " asmsyntax always nasm let g:asmsyntax = 'nasm' " set nodejs global prog " let g:node_host_prog = "/usr/bin/neovim-node-host" " Themeing " set t_Co=256 syntax on colorscheme minimalist " let g:dracula_colorterm = 0 " colorscheme dracula highlight link Crates WarningMsg " colorscheme nord if exists('+termguicolors') let &t_8f="\[38;2;%lu;%lu;%lum" let &t_8b="\[48;2;%lu;%lu;%lum" endif " set termguicolors " Airline let g:airline_theme='dracula' let g:airline_powerline_fonts = 1 let g:airline#extensions#tabline#enabled = 1 " let g:airline_statusline_ontop = 1 " " Tmuxline " let g:tmuxline_preset = { " \'a' : '#S', " \'b' : '#W', " \'c' : '#H', " \'win' : '#I #W', " \'cwin' : '#I #W', " \'x' : '%a', " \'y' : '#W %R', " \'z' : '#H'} " Lightline " let g:lightline = {} " let g:lightline.colorscheme = 'darcula' " " let g:lightline.colorscheme = 'wombat' " let g:lightline.active = {} " let g:lightline.active.left = [['mode', 'paste'] ,['readonly', 'filename', 'modified']] " let g:lightline.active.right = [['lineinfo'], ['percent'], ['fileformat', 'fileencoding', 'filetype', 'charvaluehex']] " let g:lightline.separator = { 'left': "\ue0b8", 'right': "\ue0ba" } " let g:lightline.subseparator = { 'left': "\ue0b9", 'right': "\ue0bb" } " let g:lightline.tabline = {} " let g:lightline.tabline.left = [['buffers']] " let g:lightline.tabline.right = [['close'], ['gitbranch']] " let g:lightline.tabline_separator = { 'left': "\ue0bc", 'right': "\ue0be" } " let g:lightline.tabline_subseparator = { 'left': "\ue0bd", 'right': "\ue0bf" } " let g:lightline.component_function = { 'song': 'CurrentSong', 'gitbranch': 'FugitiveHead' } " let g:lightline.component_expand = {'buffers': 'lightline#bufferline#buffers'} " let g:lightline.component_type = {'buffers': 'tabsel'} " Rust " let g:rustfmt_autosave = 1 "################################################## "# Functions "################################################## " COC.nvim function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') else call CocAction('doHover') endif endfunction " Mpc function Mpcfzf() execute("silent !mpcfzf") endfunction " Mpc Current song function CurrentSong() let s = execute("!mpc | head -1") return s endfunction