Skip to content

Instantly share code, notes, and snippets.

@sergio-gimenez
Last active September 29, 2023 12:37
Show Gist options
  • Select an option

  • Save sergio-gimenez/7a0ab0e9c113a6008749ebdcccc2b2e8 to your computer and use it in GitHub Desktop.

Select an option

Save sergio-gimenez/7a0ab0e9c113a6008749ebdcccc2b2e8 to your computer and use it in GitHub Desktop.
My vim configuration backup
call plug#begin()
Plug 'preservim/nerdtree'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'dense-analysis/ale'
Plug 'itchyny/lightline.vim'
Plug 'tpope/vim-fugitive'
call plug#end()
" Colour lightline bar
set laststatus=2
" Show line numbers
set number
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
" Mappings to shortcuts:
" ----------------------
" Map Directory Tree view
map <C-b> :NERDTreeToggle<CR>
" Map fzf plugin
map <C-e> :Files<CR>
"Map Scrolling
map <C-Up> <C-Y>
map <C-Down> <C-E>
let g:ackprg = 'ag --nogroup --nocolor --column'
map <C-S-f> :Ag<CR>
@sergio-gimenez
Copy link
Author

sergio-gimenez commented Dec 27, 2021

How to have vim ready in any machine in 1 minute

  • Download vim-plug (plugin manager for vim)

    curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    
  • Create a .vimrc file with the vim configuration. To use mine just copy this gist and paste to a .vimrc file in your home directory or run in your $HOME directory.:

    wget https://gist.githubusercontent.com/sergio-gimenez/7a0ab0e9c113a6008749ebdcccc2b2e8/raw/0363cb9ed06e168bb94c18385fc7ebfa8814b8b9/.vimrc
    
  • For "search ocurrences in all project" install first silver-searcher first with: apt-get install silversearcher-ag

  • Open vim and type :PlugInstall.

Ready :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment