Facebook
From Unreliable Lion, 1 Year ago, written in Vim scripting.
Embed
Download Paste or View Raw
Hits: 308
  1.  
  2. colorscheme gruvbox
  3. let mapleader=","
  4.  
  5. " Window Shortcuts
  6. noremap <silent> <C-S-Left> :vertical resize +3<CR>
  7. noremap <silent> <C-S-Right> :vertical resize -3<CR>
  8. noremap <silent> <C-S-Up> :resize +3<CR>
  9. noremap <silent> <C-S-Down> :resize -3<CR>
  10.  
  11. "QUICKFIX SETTINGS
  12. "Single line messages
  13. set errorformat+=%-G%.%#,%f:%l:\ %m
  14.  
  15. "autocmd FileType qf call setpos('.', [0, 1, 1, 0]) | execute 'silent! 1,' . (line('$')-1) . 'g/error:/move 0' | redraw!
  16.  
  17. "Sorting error messages to top of the list
  18. function! SortQuickfix()
  19.     let lines = getqflist()
  20.     let errors = filter(copy(lines), 'v:val.text =~ "error:"')
  21.     let warnings = filter(copy(lines), 'v:val.text =~ "warning:"')
  22.     let infos = filter(copy(lines), 'v:val.text !~ "error:" && v:val.text !~ "warning:"')
  23.  
  24.     call setqflist(errors + warnings + infos)
  25.     call setpos('.', [0, 1, 1, 0])
  26.     redraw!
  27. endfunction
  28. autocmd FileType qf call SortQuickfix()
  29.  
  30. "Coloring error and warning messages
  31. autocmd FileType qf highlight QuickFixWarning ctermbg=yellow ctermfg=black
  32. autocmd FileType qf call matchadd('QuickFixWarning', '\v(warning:)')
  33.  
  34. autocmd FileType qf highlight QuickFixError ctermbg=red ctermfg=white
  35. autocmd FileType qf call matchadd('QuickFixError', '\v(error:)')
  36.  
  37.  
  38.  
  39.  
  40. call plug#begin()
  41.         Plug 'ryanoasis/vim-devicons'
  42.         " File Browsing and Tree
  43.         Plug 'lambdalisue/fern.vim'
  44.         Plug 'lambdalisue/fern-renderer-devicons.vim'
  45.         " Code Autocompletion, Clang, Language Support...etc   
  46.         Plug 'neoclide/coc.nvim', {'branch': 'release'} "W: required NodeJS
  47.         " Multi Cursor Select Support
  48.         Plug 'mg979/vim-visual-multi', {'branch': 'master'}
  49.         "Code Highlighting
  50.         Plug 'octol/vim-cpp-enhanced-highlight'
  51.         " Code Map Scroll Bar
  52.         Plug 'karb94/neoscroll.nvim'
  53.         Plug 'dstein64/nvim-scrollview', { 'branch': 'main' }
  54.         " Quickfix Window
  55.         Plug 'kevinhwang91/nvim-bqf'
  56.         "Status Bar
  57.         Plug 'vim-airline/vim-airline'
  58.         Plug 'vim-airline/vim-airline-themes'
  59.         "Comment Helper
  60.         Plug 'preservim/nerdcommenter'
  61.         " Bash Shell Script Needs
  62.         Plug 'rantasub/vim-bash-completion'
  63.         Plug 'itspriddle/vim-shellcheck'
  64.         Plug 'WolfgangMehner/bash-support'
  65. call plug#end()
  66.  
  67. "NERDCOMMENTER SETTINGS
  68. filetype plugin on
  69.  
  70.  
  71. "NEO SCROLL SETTINGS
  72. lua require('neoscroll').setup()
  73.  
  74. " COC SETTINGS
  75. inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
  76.                               \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
  77. " Show all diagnostics
  78. nnoremap <silent><nowait> <space>a  :<C-u>CocList diagnostics<cr>
  79. " Opening Coc Explorer (Required :CocInstall coc-explorer )
  80. :nmap <space>e <Cmd>CocCommand explorer<CR>
  81. " Diagnostics Shortcut
  82. nnoremap <silent><nowait> <leader>d :CocDiagnostics<CR>
  83.  
  84.  
  85. " FERN SETTINGS
  86. let g:fern#renderer = "devicons"
  87. nnoremap <leader><leader> :Fern . -drawer -toggle <cr>
  88. "nnoremap <C-m> :Fern . -reveal=% -toggle <cr>
  89. " Always show the signcolumn, otherwise it would shift the text each time
  90. " diagnostics appear/become resolved
  91. set signcolumn=yes
  92.  
  93. " AIRSTATUS SETTINGS
  94. let g:airline_theme='base16_gruvbox_dark_hard'
  95.  
  96. "GENERAL SETTINGS
  97. "No Swap Files
  98. set noswapfile
  99. "Mouse Input
  100. set mouse=a
  101. " Global Copy to Clipboard Operations
  102. set clipboard=unnamedplus
  103. " Show Line Numbers
  104. set number
  105. " Cursor highlight
  106. setlocal cursorline
  107.  
  108.  
  109.