Skip to content

Instantly share code, notes, and snippets.

@Santiago-j-s
Created November 7, 2020 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Santiago-j-s/bb4a1ef252dc68013eb561d3d6045847 to your computer and use it in GitHub Desktop.
Save Santiago-j-s/bb4a1ef252dc68013eb561d3d6045847 to your computer and use it in GitHub Desktop.
call plug#begin('~/.vim/plugged')
" git
Plug 'tpope/vim-fugitive'
Plug 'mhinz/vim-signify'
" status line
Plug 'itchyny/lightline.vim'
" start screen
Plug 'mhinz/vim-startify'
" easy comments (gcc, gc, gcgc)
Plug 'tpope/vim-commentary'
" surroundings, brackets, etc. (ds, cs, ys).
Plug 'tpope/vim-surround'
Plug 'Townk/vim-autoclose'
" emmet
Plug 'mattn/emmet-vim'
" language support (syntax, indentation only)
Plug 'sheerun/vim-polyglot'
" in search, print actual index and total number of matches
Plug 'vim-scripts/IndexedSearch'
" tags
" Plug 'ludovicchabant/vim-gutentags'
" Plug 'majutsushi/tagbar'
" fuzzy finder for files
Plug 'ctrlpvim/ctrlp.vim'
" snippets
Plug 'sirver/ultisnips'
" sneak s{char}{char}
Plug 'justinmk/vim-sneak'
" refactoring and completions for php files
" Plug 'ncm2/ncm2'
" Plug 'ncm2/ncm2-ultisnips'
" Plug 'roxma/nvim-yarp'
" Plug 'phpactor/phpactor' , {'do': 'composer install', 'for': 'php'}
" Plug 'phpactor/ncm2-phpactor'
" search
Plug 'mileszs/ack.vim'
call plug#end()
" fix weird symbols
" https://github.com/neovim/neovim/wiki/FAQ#nvim-shows-weird-symbols-2-q-when-changing-modes
:set guicursor=
:autocmd OptionSet guicursor noautocmd set guicursor=
" tabs and spaces
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
" show line numbers
set number
set relativenumber
" mouse support
set mouse=a
" jump to end of line while in insert mode
inoremap <C-e> <C-o>A
" tab mappings
map tt :tabnew
" clear last highlight
map <F3> :noh<CR>
" toggle tagbar
map <F4> :TagbarToggle<CR>
" shows start screen
map <F2> :Startify<CR>
" remove ugly vertical lines on window division
set fillchars+=vert:\
" fix color for dark backgrounds
" set background=dark
" support for truecolor (24-bit)
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" colorscheme
colorscheme night-owl
" fix problems with uncommon shells (fish, xonsh) and plugins running commands
" (neomake, ...)
set shell=/bin/bash
" signify colors
highlight SignColumn ctermbg=0 cterm=NONE guibg=#011627 gui=NONE
highlight DiffAdd cterm=bold ctermbg=0 ctermfg=82 guibg=#011627 guifg=#addb67
highlight DiffDelete cterm=bold ctermbg=0 guibg=#011627 guifg=#ef5350 ctermfg=167
highlight DiffChange cterm=bold ctermbg=0 guibg=#011627 guifg=#a2bffc ctermfg=227
" ncm2
" autocmd BufEnter * call ncm2#enable_for_buffer()
" set completeopt=noinsert,menuone,noselect
" supress the annoying 'match x of y', 'The only match'
" and 'Pattern not found' messages
set shortmess+=c
" CTRL-C doesn't trigger the InsertLeave autocmd . map to <ESC> instead.
inoremap <c-c> <ESC>
" When the <Enter> key is pressed while the popup menu is visible, it only
" hides the menu. Use this mapping to close the menu and also
" start a new line.
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
" Use <TAB> to select the popup menu:
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" enter key triggers snippet expansion
" inoremap <silent> <expr> <CR> ncm2_ultisnips#expand_or("\<CR>", 'n')
" c-j c-k for moving in snippet
" let g:UltiSnipsJumpForwardTrigger = "<c-j>"
" let g:UltiSnipsJumpBackwardTrigger = "<c-k>"
" let g:UltiSnipsRemoveSelectModeMappings = 0
" search with silver searcher if available
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment