Skip to content

Instantly share code, notes, and snippets.

@solyarisoftware
Last active February 17, 2020 10:12
Show Gist options
  • Save solyarisoftware/5d3fc03cac6f3fb70cfd to your computer and use it in GitHub Desktop.
Save solyarisoftware/5d3fc03cac6f3fb70cfd to your computer and use it in GitHub Desktop.
" PLUGIN USING VIM-PLUG
" https://github.com/junegunn/vim-plug
"
" Load vim-plug
if empty(glob("~/.vim/autoload/plug.vim"))
execute '!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.github.com/junegunn/vim-plug/master/plug.vim'
endif
call plug#begin('~/.vim/plugged')
"Plug 'vim-scripts/SearchComplete'
"Plug 'itchyny/vim-gitbranch'
"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
"Plug 'junegunn/fzf.vim'
"Plug 'majutsushi/tagbar'
"Plug 'vim-scripts/taglist.vim'
Plug 'TaDaa/vimade'
let g:vimade = {}
let g:vimade.detecttermcolors = 0
" post install (yarn install | npm install)
"Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'mhinz/vim-startify'
Plug 'yegappan/mru'
Plug 'scrooloose/nerdtree'
let g:NERDTreeWinPos = "right"
Plug 'ctrlpvim/ctrlp.vim'
"Plug 'ggreer/the_silver_searcher'
" TAB autocompletion
Plug 'ervandew/supertab'
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
" https://github.com/neoclide/coc.nvim
" autocomplete in search mode
Plug 'vim-scripts/CmdlineComplete'
"Plug 'vim-scripts/sherlock.vim'
"Plug 'Valloric/YouCompleteMe'
"Plug 'ajh17/VimCompletesMe'
"Plug 'ycm-core/YouCompleteMe'
"Plug 'lifepillar/vim-mucomplete'
set completeopt+=menuone
set completeopt+=noinsert "noselect
set shortmess+=c " Shut off completion messages
set belloff+=ctrlg " If Vim beeps during completion
" Zoom in/out of windows (toggle between one window and multi-window)
Plug 'vim-scripts/ZoomWin'
" Like Rails.vim for Node.
"Plug 'moll/vim-node'
" Fast and Easy Find and Replace Across Multiple Files
Plug 'dkprice/vim-easygrep'
" provides insert mode auto-completion for quotes, parens, brackets
"Plug 'Raimondi/delimitMate'
" Enhanced in-file search for Vim. Applies sane pattern syntax by default
"Plug 'wincent/loupe'
" syntax highlight
"Plug 'solyaris/ChatScript.vim'
"
" coloschemes
"
Plug 'goatslacker/mango.vim'
Plug 'arcticicestudio/nord-vim'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'ayu-theme/ayu-vim'
"set termguicolors " enable true colors support
"let ayucolor="light" " for light version of theme
let ayucolor="mirage" " for mirage version of theme
"let ayucolor="dark" " for dark version of theme
Plug 'chriskempson/base16-vim'
Plug 'lifepillar/vim-solarized8'
Plug 'mhartington/oceanic-next'
Plug 'NLKNguyen/papercolor-theme'
Plug 'jacoborus/tender.vim'
Plug 'w0ng/vim-hybrid'
Plug 'morhetz/gruvbox'
Plug 'sainnhe/gruvbox-material'
Plug 'sjl/badwolf'
Plug 'mhinz/vim-janah'
Plug 'sickill/vim-monokai'
Plug 'tomasr/molokai'
Plug 'rakr/vim-one'
Plug 'jpo/vim-railscasts-theme'
Plug 'jnurmine/Zenburn'
"Plug 'fenetikm/falcon'
"Plug 'ajh17/spacegray.vim'
"Plug 'crusoexia/vim-monokai'
"Plug 'joshdick/onedark.vim'
"
" :XtermColorTable,
"
Plug 'guns/xterm-color-table.vim'
"
" marks highlight
"
Plug 'kshenoy/vim-signature'
"Plug 'Tumbler/highlightMarks'
"let g:highlightMarks_useSigns = 1
"let g:highlightMarks_cterm_colors = [11, 121, 192, 156, 194]
"https://github.com/guns/xterm-color-table.vim
Plug 'itchyny/lightline.vim'
"Plug 'vim-airline/vim-airline'
"Plug 'vim-airline/vim-airline-themes'
" Interactive window mode
"Plug 'romgrk/winteract.vim'
" jump to line number
Plug 'bogado/file-line'
" Gist Vim
"Plug 'mattn/webapi-vim'
"Plug 'mattn/gist-vim'
"Plug 'w0rp/ale'
"let g:ale_sign_error = '>>'
"let g:ale_sign_warning = '--'
"Plug 'maximbaz/lightline-ale'
"Plug 'sheerun/vim-polyglot'
Plug 'jelera/vim-javascript-syntax'
"Plug 'pangloss/vim-javascript'
"let g:javascript_plugin_jsdoc = 1
" https://github.com/pangloss/vim-javascript/issues/184
"autocmd FileType javascript syntax clear jsFuncBlock jsFuncArgs
Plug 'luochen1990/rainbow'
let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
Plug 'jaxbot/semantic-highlight.vim'
"let g:semanticTermColors = [3,124,30,32,33,64,66,67,69,99,101,102,103,104,132,133,135,136,137,164,165,166,167,168,169,170,198,200]
let g:semanticTermColors = [3,124,30,32,34,64,66,69,96,99,101,103,105,106,130,132,134,136,138,165,166,167,168,170,178,180,182,184,186,198,201,202,204,206,208,210,212,220,222]
"Plug 'othree/yajs.vim' ", { 'for': 'javascript' }
"Plug 'othree/es.next.syntax.vim'
"Plug 'othree/jsdoc-syntax.vim'
"Plug 'heavenshell/vim-jsdoc'
"Plug 'leafgarland/typescript-vim'
Plug 'elzr/vim-json'
Plug 'mustache/vim-mustache-handlebars'
Plug 'plasticboy/vim-markdown'
Plug 'scrooloose/syntastic'
"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0
"let g:syntastic_javascript_checkers = ['jshint']
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_loc_list_height = 4
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_error_symbol = '❌'
let g:syntastic_style_error_symbol = '⁉️'
let g:syntastic_warning_symbol = '⚠️'
let g:syntastic_style_warning_symbol = '💩'
"highlight link SyntasticErrorSign SignColumn
"highlight link SyntasticWarningSign SignColumn
"highlight link SyntasticStyleErrorSign SignColumn
"highlight link SyntasticStyleWarningSign SignColumn
let g:syntastic_python_checkers = ['python3']
" All 256 xterm colors with their RGB equivalents
"Plug 'guns/xterm-color-table.vim'
" tabular is fr vim-markdown
"Plug 'godlygeek/tabular'
"Plug 'junegunn/vim-easy-align'
"Hyperfocus-writing in Vim.
"Plug 'junegunn/limelight.vim'
"Plug 'junegunn/goyo.vim'
"Plug 'tpope/vim-abolish'
"Plug 'tpope/vim-obsession'
"Plug 'tpope/vim-rails'
"Plug 'vim-ruby/vim-ruby'
"Plug 'tpope/vim-bundler'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
"Plug 'edkolev/tmuxline.vim'
"let g:tmuxline_powerline_separators = 0
"
"Plug 'benmills/vimux'
"Plug 'wkentaro/conque.vim'
"Plug 'vim-scripts/Conque-GDB'
"Plug 'chrisbra/csv.vim'
"let b:csv_arrange_leftalign = 1
"let g:csv_autocmd_arrange = 1
"let g:csv_no_conceal = 1
"let g:csv_no_column_highlight = 1
" Delete buffers and close files in Vim without closing your windows
Plug 'moll/vim-bbye'
" When editing the command-line (: / etc.), press Ctrl-P or Ctrl-N to complete
" the word before the cursor, using keywords in the current file.
"Plug 'vim-scripts/CmdlineComplete'
" provide a |star| feature for |Visual-mode|. you can search your selection text in |Visual-mode|
"Plug 'thinca/vim-visualstar'
"Plug 'brooth/far.vim'
"Plug 'junegunn/vim-pseudocl'
"Plug 'junegunn/vim-oblique'
"Plug 'dkprice/vim-easygrep'
"Plug 'amdt/vim-niji'
"Plug 'thiagoalessio/rainbow_levels.vim'
"Plug 'junegunn/rainbow_parentheses.vim'
" adds a :Qargs utility command, for populating the argument list from the files in the quickfix list.
Plug 'nelstrom/vim-qargs'
call plug#end()
set encoding=utf-8
scriptencoding utf-8
set background=dark
autocmd ColorScheme janah highlight Normal ctermbg=235
"autocmd ColorScheme janah highlight PMenu ctermfg=black ctermbg=grey
"autocmd ColorScheme janah highlight WildMenu ctermfg=black ctermbg=yellow
"colorscheme janah
colorscheme tender
syntax on " Enable syntax highlighting
syntax enable
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
" .pl file extension as a prolog file
au FileType perl set filetype=prolog
set autoindent
set wildmode=longest,list,full
set wildmenu
" Use two spaces for indentation
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Make backspace behave in a sane manner.
set backspace=indent,eol,start
" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256
set history=300
" Always show statusline
set nocompatible ruler showcmd showmode
" search settings
set incsearch ignorecase smartcase hlsearch
"hi Search cterm=NONE ctermbg=2 ctermfg=15
hi Search cterm=NONE ctermbg=LightBlue ctermfg=Black
" Splits
" Note: Check the leader key shortcuts below for some commands that might
" conflict with these if you need to change these around...
set splitright " Make vertical splits appear to the right
set splitbelow " Make horizontal splits appear to the bottom
runtime macros/matchit.vim
"runtime macros/justify.vim
"autocmd FileType ruby compiler ruby
" https://github.com/vim-ruby/vim-ruby/wiki/VimRubySupport
" help ft-ruby-omni
" CLIPBOARD settings
"http://stackoverflow.com/questions/11489428/how-to-make-vim-paste-from-and-copy-to-systems-clipboard/11489440?stw=2#11489440
"set paste " Paste from a windows or from vim. WARNING: conflict with Supertab
set go+=a " Visual selection automatically copied to the clipboard
set clipboard+=unnamed " use the clipboards of vim and win
set shortmess=aoOtI
"set number
set laststatus=2
" enable mouse
"set mouse=a
"
" AG plugin settings
"
" Use ack instead of grep
"set grepprg=ack
"let g:ackprg = 'ag --vimgrep'
"
"if executable('ag')
" " Note we extract the column as well as the file and line number
" set grepprg=ag\ --nogroup\ --nocolor\ --column
" set grepformat=%f:%l:%c%m
"
" " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
" let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
"
" " ag is fast enough that CtrlP doesn't need to cache
" let g:ctrlp_use_caching = 0
"endif
"
" CTRLP plugin settings
"
"https://medium.com/a-tiny-piece-of-vim/making-ctrlp-vim-load-100x-faster-7a722fae7df6
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
"let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:30'
"
" MARKDOWN plugin settings
"
let g:vim_markdown_folding_disabled=1
"au BufRead,BufNewFile *.json set filetype=json
"highlight markdownItalic ctermfg=251 ctermbg=none cterm=none
"
" CONQUETERM plugin settings
"
"let g:ConqueTerm_Color = 2 " 1: strip color after 200 lines, 2: always with color
"let g:ConqueTerm_CloseOnEnd = 1 " close conque when program ends running
"let g:ConqueTerm_StartMessages = 0 " display warning messages if conqueTerm is configured incorrectly
" VIM-EASY-ALIGN plugin settings
" https://github.com/junegunn/vim-easy-align
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
"vmap <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
"nmap ga <Plug>(EasyAlign)
"if !exists('g:easy_align_delimiters')
" let g:easy_align_delimiters = {}
"endif
"let g:easy_align_delimiters['#'] = { 'pattern': '/\*', 'ignore_groups': ['String'] }
"
" COMMANDS UTILITIES
"
" :Q make session in home directory
" alias v='vim -S ~/Session.vim'
"http://vi.stackexchange.com/questions/4817/is-there-a-vim-command-line-option-to-edit-last-edited-file/
command! Q mksession! ~/Session.vim | qall
" http://stackoverflow.com/questions/953398/how-to-execute-file-im-editing-in-vim
command! R let f=expand("%")|new|execute '.!ruby "' . f . '"'
"http://www.drbunsen.org/writing-in-vim/
func! WordProcessorMode()
setlocal formatoptions=1
setlocal noexpandtab
map j gj
map k gk
setlocal spell spelllang=it "en_us
"set thesaurus+=/Users/sbrown/.vim/thesaurus/mthesaur.txt
set complete+=s
set formatprg=par
setlocal wrap
setlocal linebreak
endfu
com! WP call WordProcessorMode()
"
" MAP UTILITIES
"
" http://vi.stackexchange.com/questions/3367/move-cursor-among-lines-inside-the-same-paragraph
nnoremap j gj
nnoremap k gk
" http://vi.stackexchange.com/questions/2121/how-do-i-have-buffers-listed-in-a-quickfix-window-in-vim?noredirect=1#comment1645_2121
nnoremap gb :ls<CR>:b<Space>
" remap nacktick with tick becaus I don't have backtick in Italian keyboard
nmap ' `
" Use <leader> for command line.
"imap <leader> <esc>:
"nnoremap <leader> :<CR>
"nnoremap <C-A> :CtrlPBuffer<CR>
map <C-A> :buffer <Space>
"map \ :
"noremap <Leader>n" find files / directory management
"map <F1> :CtrlP<CR>
"map <F2> :NERDTreeToggle<CR>
"map <F3> :bprev<CR>
"map <F4> :bnext<CR>
" http://stackoverflow.com/questions/7672783/how-can-i-do-something-like-gf-but-in-a-new-vertical-split
"nnoremap <F8> :vertical wincmd f<CR>
"nnoremap <F9> :<C-W>f<CR><C-W>H<C-W>x
" Use CTRL-S for saving, also in Insert mode
" http://vim.wikia.com/wiki/Map_Ctrl-S_to_save_current_or_new_files
"noremap <C-S> :update<CR>
"vnoremap <C-S> <C-C>:update<CR>
"inoremap <C-S> <C-O>:update<CR>
" pretty print enum/struct in C/C++
"map <leader> viB<CR><space>viB<CR>=viB<CR>#
" CTRL-I <- change word with yanked text
"http://unix.stackexchange.com/questions/88714/vim-how-can-i-do-a-change-word-using-the-current-paste-buffer
map <C-I> cw<C-r>0<ESC>
"move amongs buffers with CTRL
map <C-J> :bnext<CR>
map <C-K> :bprev<CR>
"map <C-L> :tabn<CR>
"map <C-H> :tabp<CR>
" error console window
map <C-E> :cnext<CR>
"map <F5> :cnext<CR>
"map <F6> :cprevious<CR>
" Insert newline without entering insert mode
"nmap <S-Enter> O<Esc>
"nmap <CR> o<Esc>
command! Make silent w | silent make | cw
"let homedir = "~/ofplib"
"let sources = homedir . "/**"
"command! Path set path+=~/ofplib/**
"command! Grep :execute 'vimgrep /'.expand('<cword>').'/gj ~/ofplib/**/*.hpp ~/ofplib/**/*.cpp ' | cw
"command! -nargs=1 GrepArg execute 'vimgrep /'.expand(<q-args>).'/gj ~/ofplib/**/*.hpp ~/ofplib/**/*.cpp ' | cw
" http://vi.stackexchange.com/questions/2121/how-do-i-have-buffers-listed-in-a-quickfix-window-in-vim
command! Qbuffers call setqflist(map(filter(range(1, bufnr('$')), 'buflisted(v:val)'), '{"bufnr":v:val}'))
autocmd InsertLeave,WinEnter * set cursorline
autocmd InsertEnter,WinLeave * set nocursorline
" CURSOR
" http://stackoverflow.com/questions/6488683/how-do-i-change-the-vim-cursor-in-insert-normal-mode
"set cursorline
"hi CursorLine ctermbg=black
"autocmd InsertEnter,InsertLeave * set cul!
"au WinLeave * set nocursorline nocursorcolumn
"au WinEnter * set cursorline cursorcolumn
"set cursorline cursorcolumn
autocmd InsertEnter * highlight CursorLine ctermbg=black
" https://stackoverflow.com/a/6489348/1786393
autocmd InsertEnter,InsertLeave * set cul!
" https://stackoverflow.com/a/42118416/1786393
let &t_SI = "\e[6 q"
let &t_EI = "\e[4 q"
" optional reset cursor on start:
augroup myCmds
au!
autocmd VimEnter * silent !echo -ne "\e[4 q"
augroup END
" http://stackoverflow.com/questions/1236563/how-do-i-run-a-terminal-inside-of-vim
noremap <C-d> :sh<cr>
set path+=**
let g:netrw_banner=0
let g:netrw_browse_split=4
let g:netrw_altv=1
let g:netrw_liststyle=3
let g:netrw_liststyle=3
" https://stackoverflow.com/questions/1620018/copy-all-the-lines-to-clipboard
command! CopyClipboard execute 'normal gg"*yG'
" https://stackoverflow.com/questions/11553374/how-to-print-vim-current-color-scheme
command! HICOLORS so $VIMRUNTIME/syntax/hitest.vim
" https://dev.to/jovica/the-vim-trick-which-will-save-your-time-and-nerves-45pg
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
" screen lines to keep above and below the cursor
set scrolloff=6
"set number
"set t_u7=
"set t_8b=
"autocmd BufEnter * :SemanticHighlight
"set tags=./tags,tags;$HOME
set tags=tags
" https://github.com/itchyny/vim-gitbranch
"let g:lightline = {
" \ 'active': {
" \ 'left': [ [ 'mode', 'paste' ],
" \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
" \ },
" \ 'component_function': {
" \ 'gitbranch': 'gitbranch#name'
" \ },
" \ }
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename', 'modified' ] ],
\ 'right': [ [ 'lineinfo' ],
\ [ 'percent' ],
\ [ 'fileformat', 'fileencoding', 'filetype', 'gitbranch' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'gitbranch#name'
\ },
\ }
"https://www.reddit.com/r/vim/comments/euaocz/autocompletion_in_command_linesearch_modes/
"cnoremap <Tab> <C-F>A<C-N>
"cmap <Tab> <C-F>A<C-N>
" https://vi.stackexchange.com/a/22697/983
"cmap <Tab> <C-f>a<Tab>
"cnoremap <expr> <Tab> getcmdtype() == ':' ? '<C-f>A<C-x><C-v>' : '<C-f>A<C-n>'
" http://howivim.com/2016/salvatore-sanfilippo/
" When open a new file remember the cursor position of the last editing
"if has("autocmd")
" " When editing a file, always jump to the last cursor position
" autocmd BufReadPost * if line("'\"") | exe "'\"" | endif
"endif
autocmd BufLeave,BufWinLeave * silent! mkview
autocmd BufReadPost * silent! loadview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment