Update vimrc
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.netrwhist
|
||||
*
|
||||
!init.vim
|
||||
|
||||
56
init.vim
56
init.vim
@@ -1,16 +1,32 @@
|
||||
" Plugins --- {{{
|
||||
|
||||
if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
|
||||
echo "Downloading junegunn/vim-plug to manage plugins..."
|
||||
silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/
|
||||
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim
|
||||
autocmd VimEnter * PlugInstall
|
||||
endif
|
||||
|
||||
call plug#begin(stdpath('data') . '/plugged')
|
||||
Plug 'rafi/awesome-vim-colorschemes'
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'phpactor/phpactor', { 'do': 'composer install', 'for': 'php' }
|
||||
Plug 'ncm2/ncm2'
|
||||
Plug 'roxma/nvim-yarp'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'tpope/vim-unimpaired'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'pangloss/vim-javascript'
|
||||
Plug 'mattn/emmet-vim'
|
||||
"Plug 'sheerun/vim-polyglot'
|
||||
|
||||
autocmd BufEnter * call ncm2#enable_for_buffer()
|
||||
set completeopt=noinsert,menuone,noselect
|
||||
"Plug 'phpactor/phpactor', { 'do': 'composer install', 'for': 'php' }
|
||||
"Plug 'ncm2/ncm2'
|
||||
"Plug 'roxma/nvim-yarp'
|
||||
|
||||
Plug 'phpactor/ncm2-phpactor'
|
||||
"autocmd BufEnter * call ncm2#enable_for_buffer()
|
||||
"set completeopt=noinsert,menuone,noselect
|
||||
|
||||
"Plug 'phpactor/ncm2-phpactor'
|
||||
call plug#end()
|
||||
" }}}
|
||||
|
||||
@@ -32,13 +48,13 @@ set backupdir=/tmp// "Store backup files in the /tmp directory
|
||||
set directory=/tmp// "Store swap files in the /tmp directory
|
||||
set undodir=/tmp// "Store undo history in the /tmp directory
|
||||
set undofile "Store the undo history
|
||||
set spell "Enable spell checking
|
||||
"set spell "Enable spell checking
|
||||
set autowriteall "Save the file when switching buffers
|
||||
"}}}
|
||||
|
||||
" Visuals ---- {{{
|
||||
colorscheme nord
|
||||
set t_Co=256 "User 256 colors. This is useful for terminal vim
|
||||
colorscheme atom-dark
|
||||
" set t_Co=256 "User 256 colors. This is useful for terminal vim
|
||||
set guifont=Fira_Code:h17
|
||||
set guioptions-=e "We don't want GUI tabs
|
||||
|
||||
@@ -99,7 +115,7 @@ nnoremap ; :
|
||||
|
||||
"Append the line with a semicolon
|
||||
inoremap <Leader>; <Esc>mzA;<Esc>`za
|
||||
nnoremap <Leader>; mzA;<Esc>`za
|
||||
nnoremap <Leader>; mzA;<Esc>`za<Esc>
|
||||
|
||||
"Easily navigate items in the quickfix menu
|
||||
nnoremap <Leader>] :cnext<cr>
|
||||
@@ -113,6 +129,26 @@ nnoremap <Leader>} mzF[`a<cr><Esc>``%i<cr><Esc>`zvi[:s/,\s*/,\r/g<cr>vi[=<Esc>`z
|
||||
com! FormatJSON %!python -m json.tool
|
||||
" }}}
|
||||
|
||||
" Plugins --- {{{
|
||||
|
||||
" Toggle emmet completion useing <Tab> with <Leader>em
|
||||
let g:emmet_completion = 0
|
||||
function ToggleEmmet()
|
||||
if g:emmet_completion
|
||||
echo "Emmet completion off!"
|
||||
let g:user_emmet_expandabbr_key=','
|
||||
iunmap <tab>
|
||||
let g:emmet_completion = 0
|
||||
else
|
||||
echo "Emmet completion on!"
|
||||
let g:user_emmet_expandabbr_key='<Tab>'
|
||||
imap <expr> <tab> emmet#expandAbbrIntelligent("\<tab>")
|
||||
let g:emmet_completion = 1
|
||||
endif
|
||||
endfunction
|
||||
nnoremap <Leader>em :call ToggleEmmet()<cr>
|
||||
" }}}
|
||||
|
||||
" Moving around --- {{{
|
||||
"Use capital H and L to move to the start and end of lines
|
||||
nnoremap H ^
|
||||
|
||||
Reference in New Issue
Block a user