Last active
May 4, 2020 18:18
-
-
Save itSQualL/c42fa54d94a4144e5f0cf7b9a8329d20 to your computer and use it in GitHub Desktop.
nvim config #vim #nvim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"solargraph.definitions": true, | |
"solargraph.diagnostics": true, | |
"solargraph.formatting": true, | |
"solargraph.hover": true, | |
"solargraph.references": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin('~/.local/share/nvim/plugged') | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'mbbill/undotree' | |
Plug 'terryma/vim-multiple-cursors' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'vim-airline/vim-airline' | |
Plug 'joshdick/onedark.vim' | |
Plug 'tpope/vim-fugitive' | |
Plug 'tpope/vim-rails' | |
Plug 'tpope/vim-unimpaired' | |
Plug 'tpope/vim-eunuch' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-repeat' | |
Plug 'tpope/vim-rhubarb' | |
Plug 'ntpeters/vim-better-whitespace' | |
Plug 'sheerun/vim-polyglot' | |
Plug 'airblade/vim-rooter' | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'mileszs/ack.vim' | |
Plug 'JamshedVesuna/vim-markdown-preview' | |
call plug#end() | |
" -----General settings----- | |
syntax enable " Enable syntax highlighting | |
set encoding=utf-8 " Use an encoding that supports unicode | |
set number " Show line numbers | |
set ruler " Show line and column number | |
set nowrap " Don't wrap lines | |
set list " Show invisible characters | |
set backspace=indent,eol,start " Backspace through everything in insert mode | |
set visualbell " Quitar beep de los cojones | |
set shell=/bin/zsh " External commands shell | |
set backupdir^=~/.config/nvim/_backup// " Backup files | |
set directory^=~/.config/nvim/_temp// " Swap files | |
set background=dark " Default color maps for dark background | |
set laststatus=2 " Always display the status bar | |
" Indentation options | |
set autoindent " New lines inherit the indentation of previous lines | |
set tabstop=2 " A tab is two spaces | |
set shiftwidth=2 " An autoindent (with <<) is two spaces | |
set expandtab " Use spaces, not tabs | |
" Search options | |
set hlsearch " Highlight matches | |
set incsearch " Incremental searching | |
set ignorecase " Searches are case insensitive... | |
set smartcase " ... unless they contain at least one capital letter | |
" Mouse support | |
set mouse=a " Enable the use of the mouse | |
" List chars | |
set listchars="" " Reset the listchars | |
set listchars=tab:\ \ " A tab should display as " ", trailing whitespace as "." | |
set listchars+=trail:. " Show trailing spaces as dots | |
set listchars+=extends:> " The character to show in the last column when wrap is | |
" off and the line continues beyond the right of the screen | |
set listchars+=precedes:< " The character to show in the last column when wrap is | |
" Ignore files | |
set wildignore+=*.o,*.out,*.obj,.git,*.rbc,*.rbo,*.class,.svn,*.gem " Disable output and VCS files | |
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz " Disable archive files | |
set wildignore+=*/vendor/gems/*,*/vendor/cache/*,*/.bundle/*,*/.sass-cache/* " Ignore bundler and sass cache | |
set wildignore+=*/tmp/librarian/*,*/.vagrant/*,*/.kitchen/*,*/vendor/cookbooks/* " Ignore librarian-chef, vagrant, test-kitchen and Berkshelf cache | |
set wildignore+=*/tmp/cache/assets/*/sprockets/*,*/tmp/cache/assets/*/sass/* " Ignore rails temporary asset caches | |
set wildignore+=*.swp,*~,._* " Disable temp and backup files | |
set wildignore+=*/node_modules/* " Ignore node modules | |
" Activa true colors en la terminal | |
set termguicolors | |
" Activa tema onedark | |
colorscheme onedark | |
" permite copiar al clipboard | |
set clipboard+=unnamedplus | |
" -----Custom mappings----- | |
"" Leader key | |
let mapleader = "," | |
" Reselect visual block after indent/outdet | |
vmap < <gv | |
vmap > >gv | |
" Use jk as <Esc> | |
imap jk <Esc> | |
" Save with ,s | |
noremap <Leader>s :w<CR> | |
" Move on popups with j and k | |
function! OmniPopup(action) | |
if pumvisible() | |
if a:action == 'j' | |
return "\<C-N>" | |
elseif a:action == 'k' | |
return "\<C-P>" | |
endif | |
endif | |
return a:action | |
endfunction | |
inoremap <silent> <C-j> <C-R>=OmniPopup('j')<CR> | |
inoremap <silent> <C-k> <C-R>=OmniPopup('k')<CR> | |
" -----Custom settings for plugins----- | |
" Markdown Preview options | |
let vim_markdown_preview_github=1 | |
let vim_markdown_preview_toggle=1 | |
let vim_markdown_preview_hotkey='<C-m>' | |
" Nerdtree | |
" Open nerdtree with Ñ | |
nmap Ñ :NERDTree <CR> | |
" Open the current file in the tree | |
nmap ,ñ :NERDTreeFind<CR> | |
" Open nerdtree on start | |
autocmd vimenter * NERDTree | |
" Nerdcommenter | |
" Comment out the current line or text selected in visual mode with ñ | |
map ñ :call NERDComment(0,"toggle") <CR> | |
" Fzf | |
" Open file finder | |
nmap <C-p> :Files<CR> | |
" https://github.com/junegunn/fzf#respecting-gitignore | |
let $FZF_DEFAULT_COMMAND = 'ag -g ""' | |
" Open file history | |
nmap <Leader>h :History<CR> | |
" Undotree | |
" Open undo tree | |
nnoremap <F5> :UndotreeToggle<CR> | |
" Vim-multiple-cursors | |
" https://github.com/terryma/vim-multiple-cursors#gmulti_cursor_insert_maps-default- | |
let g:multi_cursor_insert_maps={'j':1} | |
" VIM-airline | |
let g:airline#extensions#tabline#fnamemod = ':t' " Mostrar sólo el nombre del archivo | |
" Cargar fuente Powerline y símbolos (ver nota) | |
let g:airline_powerline_fonts = 1 | |
set noshowmode " No mostrar el modo actual (ya lo muestra la barra de estado) | |
" Move lines with control | |
" Bubble single lines | |
nmap <C-Up> [e | |
nmap <C-Down> ]e | |
nmap <C-k> [e | |
nmap <C-j> ]e | |
" Bubble multiple lines | |
vmap <C-Up> [egv | |
vmap <C-Down> ]egv | |
vmap <C-k> [egv | |
vmap <C-j> ]egv | |
" Coc.nvim | |
" Map for document filetypes so the server could handle current document as another filetype | |
let g:coc_filetype_map = { | |
\ 'svelte': 'javascript', | |
\ } | |
" Remap keys for gotos | |
nmap <silent> gd <Plug>(coc-definition) | |
nmap <silent> gr <Plug>(coc-references) | |
" Use K to show documentation in preview window | |
nnoremap <silent> K :call <SID>show_documentation()<CR> | |
function! s:show_documentation() | |
if (index(['vim','help'], &filetype) >= 0) | |
execute 'h '.expand('<cword>') | |
else | |
call CocAction('doHover') | |
endif | |
endfunction | |
"Format on save | |
au BufWritePre * call CocAction('format') | |
if executable('ag') | |
let g:ackprg = 'ag --vimgrep' | |
endif | |
" -----References----- | |
" https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation | |
" http://stevelosh.com/blog/2010/09/coming-home-to-vim/ | |
" https://github.com/carlhuda/janus/blob/f285edf1533eaecf526dabe0962dcd5107319af7/janus/vim/core/before/plugin/ | |
" Script to print colors: https://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get -y install silversearcher-ag xclip | |
sudo wget -O /usr/local/bin/nvim https://github.com/neovim/neovim/releases/download/stable/nvim.appimage | |
sudo chmod +x /usr/local/bin/nvim | |
mkdir -p ~/.config/nvim/_temp ~/.config/nvim/_backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment