first commit

This commit is contained in:
Diogo Cordeiro
2018-10-02 21:41:43 +01:00
committed by Diogo Peralta Cordeiro
commit c6cc2d3f9d
150 changed files with 13143 additions and 0 deletions

View File

@@ -0,0 +1,126 @@
# functions test
snippet /^test/ "Main function" r
func Test_${1:Func}(t *testing.T) {
${0:${VISUAL}}
}
endsnippet
snippet tt "table-driven tests"
func Test_${1:Func}(t *testing.T) {
testCases := []struct {
name string
expected ${2}
${3}
}{
{
name: "happy case",
expected: ${4},
${5},
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
actual := ${7}$1(${6:params})
if $8 {
t.Errorf("Expected %v, actual %v", tc.expected, actual)
}
})
}
}
endsnippet
snippet tte "table-driven tests with errors"
func Test_${1:Func}(t *testing.T) {
testCases := []struct {
name string
expected ${2}
${3}
wantErr bool
}{
{
name: "happy case",
expected: ${4}
${5},
wantErr: false,
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
actual, err := ${7}$1(${6:params})
if (err != nil) != tc.wantErr {
t.Errorf("Error '%v' even if wantErr is %t", err, tc.wantErr)
return
}
if tc.wantErr == false && $8 {
t.Errorf("Expected %v, actual %v", tc.expected, actual)
}
})
}
}
endsnippet
snippet err "Basic error handling" b
if err != nil {
${1}
}
endsnippet
snippet errr "Basic error handling return err" b
if err != nil {
return err
}
${1}
endsnippet
snippet errr, "Basic error handling return err with another return" b
if err != nil {
return ${1:nil}, err
}
endsnippet
snippet errw "Return wrapped error" b
if err != nil {
return errors.Wrap(err, "${1}")
}
endsnippet
snippet errwf "Basic error handling with wrapping format" b
if err != nil {
return errors.Wrapf(err, "${1}", ${2})
}
endsnippet
snippet errab "Basic abort with error from Gin Context" b
if err != nil {
_ = c.AbortWithError(http.StatusInternalServerError, err)
return
}
endsnippet
snippet errabwf "Basic abort with error from Gin Context" b
if err != nil {
err = errors.Wrapf(err, "${1}", ${2})
c.AbortWithError(http.StatusInternalServerError, err)
return
}
endsnippet
snippet /^package/ "Package declaration" b
// Package $1 provides ...
package ${1:main}
$2
endsnippet
snippet switcht "Switch type statement" b
switch ${1:expression}${1/(.+)/ /} := ${2:var}.(Type) {
case ${0:int}
}
endsnippet
snippet e: "Variable declaration := with error" b
${1:name}, err:= ${0:value}
endsnippet

View File

@@ -0,0 +1,11 @@
snippet faf "Fat arrow function (faf)" w
${1:function_name} = (${2:argument}) => {
${VISUAL}$0
}
endsnippet
snippet afaf "Anonymous fat arrow function (faf)" w
(${1:argument}) => {
${VISUAL}$0
}
endsnippet

View File

@@ -0,0 +1,154 @@
snippet ns "namespace declaration" b
namespace ${1:`!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
if m:
snip.rv = m.group().replace('/', '\\')
`};
endsnippet
snippet class "Class declaration template with strict mode" b
<?php declare(strict_types=1);
namespace ${1:`!p
relpath = os.path.relpath(path)
m = re.search(r'[A-Z].+(?=/)', relpath)
if m:
snip.rv = m.group().replace('/', '\\')
`};
class ${1:`!p snip.rv=snip.basename`}
{
}
endsnippet
snippet classa "Class declaration template with App/ begin namespace" b
<?php
namespace App\\${1:`!p
relpath = os.path.relpath(path)
m = re.search(r'[A-Z].+(?=/)', relpath)
if m:
snip.rv = m.group().replace('/', '\\')
`};
class ${1:`!p snip.rv=snip.basename`}
{
}
endsnippet
snippet interface "Interface declaration template" b
<?php
namespace ${1:`!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
if m:
snip.rv = m.group().replace('/', '\\')
`};
/**
* Interface ${1:`!p snip.rv=snip.basename`}
*/
interface $1
{
public function ${3:someFunction}();$4
}
}
endsnippet
snippet pub "Public function" b
public function ${1:name}(${2:params})
{
$0${VISUAL}${3:return null;}
}
endsnippet
snippet pro "Protected function" b
protected function ${1:name}()
{
${VISUAL}${5:return null;}
}
$0
endsnippet
snippet pri "Private function" b
private function ${1:name}()
{
${VISUAL}${5:return null;}
}
$0
endsnippet
snippet pubs "Public static function" b
public static function ${1:name}()
{
${VISUAL}${5:return null;}
}
$0
endsnippet
snippet pros "Protected static function" b
protected static function ${1:name}()
{
${VISUAL}${5:return null;}
}
$0
endsnippet
snippet pris "Private static function" b
private static function ${1:name}()
{
${VISUAL}${5:return null;}
}
$0
endsnippet
snippet fu "Function snip" b
function ${1:name}()
{
${VISUAL}${3:return null;}
}
$0
endsnippet
snippet new "New class instance" b
$${1:variableName} = new ${2:${1/\w+\s*/\u$0/}}($3);
$0
endsnippet
snippet ns "namespace declaration" b
namespace ${1:`!p
relpath = os.path.relpath(path)
m = re.search(r'[A-Z].+(?=/)', relpath)
if m:
snip.rv = m.group().replace('/', '\\')
`};
endsnippet
snippet addS "doctrine add sql" b
$this->addSql("
$0
");
endsnippet
snippet classst "Symlex test class declaration" b
<?php
namespace App\\${1:`!p
relpath = os.path.relpath(path)
m = re.search(r'[A-Z].+(?=/)', relpath)
if m:
snip.rv = m.group().replace('/', '\\')
`};
use TestTools\TestCase\UnitTestCase;
class ${1:`!p snip.rv=snip.basename`} extends UnitTestCase
{
}
endsnippet
snippet @var "var phpdoc" b
/** @var $0 */
endsnippet

View File

@@ -0,0 +1,822 @@
" As recommended by `:help provider`, define a venv just for neovim that has
" the neovim module and some Python linters
let g:python3_host_prog = expand('~/.config/nvim/env/bin/python')
" Enable nocompatible
if has('vim_starting')
" set default encoding to utf-8
" Let Vim use utf-8 internally, because many scripts require this
exe 'set encoding=utf-8'
scriptencoding utf-8
if &compatible
set nocompatible
endif
" python host
if !empty($PYTHON_HOST_PROG)
let g:python_host_prog = $PYTHON_HOST_PROG
endif
if !empty($PYTHON3_HOST_PROG)
let g:python3_host_prog = $PYTHON3_HOST_PROG
endif
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sections:
" -> Settings (01-settings)
" -> Theme (02-theme)
" -> Keymap (10-keymap-general, 11-keymap-rtl)
" -> File type specific (31-file-type.vim)
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ==================================================
" Basic Settings
" ==================================================
let mapleader="\<Space>" " Change the leader to be a space
set cmdheight=2 " Make command line two lines high
set scrolloff=7 " Set 7 lines to the cursor - when moving vertically using j/k
set sidescrolloff=5 " Have some context around the current line always on screen
set cursorline " Have a line indicate the cursor location (slow)
set autoindent " Always set autoindenting on
set smartindent " Set smart indent
set showcmd " Display incomplete commands
set ruler " Show the cursor position all the time
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%)
set number norelativenumber " Show line numbers
set ttyfast " Smoother changes
set modeline " Last lines in document sets vim mode
set shortmess=atIc " Abbreviate messages
set nostartofline " Don't jump to first character when paging
set backspace=indent,eol,start
set matchpairs+=<:> " Show matching <> (html mainly) as well
set showmatch " Show matching brackets when text indicator is over them
set matchtime=3 " How many tenths of a second to blink when matching brackets
set showmatch " Show matching braces, somewhat annoying...
set history=1000 " Sets how many lines of history VIM has to remember
set showmode " Show the default mode text (e.g. -- INSERT -- below the statusline)
set timeout ttimeoutlen=50
set updatetime=300 " Smaller updatetime for CursorHold & CursorHoldI
set signcolumn=yes
set whichwrap+=<,>,h,l,[,]
set fileformats=unix,dos,mac
set encoding=utf-8
set completeopt=longest,menuone " Preview mode causes flickering
set clipboard+=unnamedplus " Share the system clipboard
set splitright " Splits to the right
autocmd VimResized * wincmd = " Automatically equalize splits when Vim is resized
set wildmenu " show list instead of just completing
set wildmode=list:longest,full " command <Tab> completion, list matches, then longest common part, then all.
set completeopt=menu " Just show the menu upon completion (faster)
syntax on
set synmaxcol=200 " Syntax highlight only the first 200 chars"
filetype plugin on
filetype indent plugin on
set colorcolumn=80
"set colorcolumn=125 " Comfortable _and_ Github's line length
if has('linebreak') " Break indent wrapped lines
set breakindent
let &showbreak = '↳ '
set cpo+=n
end
" Linebreak on 500 characters
set lbr
set tw=80
" ==================================================
" Turn persistent undo on means that you can undo
" even when you close a buffer/VIM
" ==================================================
set directory=~/.nvim_runtime/temp_dirs/swap/
set backupdir=~/.nvim_runtime/temp_dirs/backup/
try
set undodir=~/.nvim_runtime/temp_dirs/undodir
set undofile
catch
endtry
" ==================================================
" Status line
" ==================================================
" Always show the status line
set laststatus=2
" Format the status line
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c
" Returns true if paste mode is enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
endif
return ''
endfunction
" ==================================================
" Use terminal title as an output
" ==================================================
set title
set titleold="Terminal"
set titlestring=%F
" ==================================================
" No annoying sound on errors
" ==================================================
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Properly disable sound on errors on MacVim
if has("gui_macvim")
autocmd GUIEnter * set vb t_vb=
endif
" ==================================================
" Tab expanded to 8 spaces
" ==================================================
set tabstop=8 " numbers of spaces of tab character
set shiftwidth=8 " numbers of spaces to (auto)indent
set expandtab " Tab to spaces by default
set softtabstop=8
set smarttab " Be smart when using tabs ;)
" ==================================================
" Search settings
" ==================================================
set hlsearch " highlight searches
set incsearch " do incremental searching
set ignorecase " ignore case when searching
set infercase " smarter completions that will be case aware when ignorecase is on
set smartcase " if searching and search contains upper case, make case sensitive search
set list listchars=trail,tab-
set fillchars+=vert:\
" ==================================================
" No modelines for security
" ==================================================
set modelines=0
set nomodeline
" ==================================================
" Trailing whitespace handling
" ==================================================
" Highlight end of line whitespace.
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/
" ==================================================
" Further settings
" ==================================================
" Try to display very long lines, rather than showing @
set display+=lastline
" show trailing whitespace as -, tabs as >-
set listchars=tab:>-,trail:-
set list
" Live substitution
set inccommand=split
if has("nvim")
set laststatus=1
endif
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
if has("win16") || has("win32")
set wildignore+=.git\*,.hg\*,.svn\*
else
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
endif
" Don't redraw while executing macros (good performance config)
set lazyredraw
" For regular expressions turn magic on
set magic
" when at 3 spaces, and I hit > ... go to 4, not 7
set shiftround
" number of undo saved in memory
set undolevels=10000 " How many undos
set undoreload=10000 " number of lines to save for undo
" set list
set list listchars=tab:\┆\ ,trail,nbsp
" doesn't prompt a warning when opening a file and the current file was written but not saved
set hidden
" no swap file! This is just annoying
set noswapfile
" Fold related
set foldlevelstart=0 " Start with all folds closed
" Set foldtext
set foldtext=general#FoldText()
" Show the substitution LIVE
set inccommand=nosplit
" for vertical pane in git diff tool
set diffopt+=vertical
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Set to auto read when a file is changed from the outside
set autoread
" indentLine
let g:indentLine_char = '▏'
let g:indentLine_color_gui = '#363949'
" vim:set et sw=2:
" ==================================================
" Color scheme and fonts
" ==================================================
let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
let g:material_theme_style = 'palenight'
" disable the mouse - who needs a mouse??
set mouse-=a
set guicursor=
" Set font according to system
if has("mac") || has("macunix")
set gfn=IBM\ Plex\ Mono:h14,Hack:h14,Source\ Code\ Pro:h15,Menlo:h15
elseif has("win16") || has("win32")
set gfn=IBM\ Plex\ Mono:h14,Source\ Code\ Pro:h12,Bitstream\ Vera\ Sans\ Mono:h11
elseif has("gui_gtk2")
set gfn=IBM\ Plex\ Mono:h14,:Hack\ 14,Source\ Code\ Pro\ 12,Bitstream\ Vera\ Sans\ Mono\ 11
elseif has("linux")
set gfn=IBM\ Plex\ Mono:h14,:Hack\ 14,Source\ Code\ Pro\ 12,Bitstream\ Vera\ Sans\ Mono\ 11
elseif has("unix")
set gfn=Monospace\ 11
endif
" Disable scrollbars (real hackers don't use scrollbars for navigation!)
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
" Enable 256 colors palette in Gnome Terminal
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
set background=dark
"colorscheme material
set t_Co=256
colorscheme desert
hi Conceal guifg=#81A1C1 guibg=NONE ctermbg=NONE
let g:palenight_terminal_italics=1
let g:material_terminal_italics = 1
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
" Opaque Background (Comment out to use terminal's profile)
set termguicolors
endif
" Set extra options when running in GUI mode
if has("gui_running")
set guioptions-=T
set guioptions-=e
set t_Co=256
set guitablabel=%M\ %t
endif
highlight Pmenu guibg=white guifg=black gui=bold
highlight Comment gui=bold
highlight Normal gui=none
highlight NonText guibg=none
" Transparent Background (For i3 and compton)
highlight Normal guibg=NONE ctermbg=NONE
highlight LineNr guibg=NONE ctermbg=NONE
"" This will repair colors in Tmux.
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
"" Tmuxline
let g:tmuxline_theme = 'vim_statusline_3'
let g:tmuxline_preset = 'tmux'
"" Bufferline
let g:bufferline_echo = 0 " This will keep your messages from getting quickly hidden.
" vim:set et sw=2:
" ==================================================
" Basic Mappings
" ==================================================
" Maps for jj to act as Esc in insert and command modes
ino jj <esc>
cno jj <c-c>
" One can map ctrl-c to something else if needed
map <c-c> <Nop>
imap <c-c> <Nop>
" Smarter j/k navigation
" Convert the j and k movement commands from strict linewise movements to
" onscreen display line movements via the gj and gk commands. When
" preceded with a count we want to go back to strict linewise movements.
" will automatically save movements larger than 5 lines to the jumplist.
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
" Center next/previous matched string
nnoremap n nzz
nnoremap N Nzz
" Save session
exec 'nnoremap <Leader>ss :mksession! ~/.nvim_runtime/sessions/*.vim<C-D><BS><BS><BS><BS><BS>'
" Reload session
exec 'nnoremap <Leader>sl :so ~/.nvim_runtime/sessions/*.vim<C-D><BS><BS><BS><BS><BS>'
" quick make
map <F6> :make<CR>
" simple pasting from the system clipboard
" http://tilvim.com/2014/03/18/a-better-paste.html
map <Leader>p :set paste<CR>o<esc>"+]p:set nopaste<cr>
" Quickly save, quit, or save-and-quit
map <leader>w :w<CR>
map <leader>x :x<CR>
map <leader>q :q<CR>
" un-highlight when esc is pressed
map <silent><esc> :noh<cr>
" Quickly toggle relative line numbers
function ToggleRelativeLineNumbers()
set invnumber
set invrelativenumber
endfunction
nnoremap <leader>l :call ToggleRelativeLineNumbers()<cr>
" Toggle between absolute -> relative line number
"nnoremap <C-n> :let [&nu, &rnu] = [&nu, &nu+&rnu==1]<CR>
" Save files as root
cnoremap w!! execute ':w suda://%'
" ==================================================
" vimrc handling
" ==================================================
" ,v loads .vimrc
" ,V reloads .vimrc -- activating changes (needs save)
map <leader>v :sp ~/.config/nvim/init.vim<CR><C-W>_
map <silent> <leader>V :source ~/.config/nvim/init.vim<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
" ==================================================
" Window navigation
" ==================================================
" control + vim direction key to navigate windows
noremap <C-J> <C-W>j
noremap <C-K> <C-W>k
noremap <C-H> <C-W>h
noremap <C-L> <C-W>l
" control + arrow key to navigate windows
noremap <C-Down> <C-W>j
noremap <C-Up> <C-W>k
noremap <C-Left> <C-W>h
noremap <C-Right> <C-W>l
" close all windows except the current one
nnoremap <leader>wco :only<cr>
nnoremap <leader>wcc :cclose<cr>
" windows creation
" create window on the bottom
nnoremap <leader>wb <c-w>s
" create vertival window
nnoremap <leader>wv <c-w>v
" " arrow keys resize windows
" nnoremap <Left> :vertical resize -10<CR>
" nnoremap <Right> :vertical resize +10<CR>
" nnoremap <Up> :resize -10<CR>
" nnoremap <Down> :resize +10<CR>
" imap <up> <nop>
" imap <down> <nop>
" imap <left> <nop>
" imap <right> <nop>
" ==================================================
" Splits handling
" ==================================================
" Make these all work in insert mode
imap <C-W> <C-O><C-W>
" - and + to resize horizontal splits
map - <C-W>-
map + <C-W>+
" alt-< or alt-> for vertical splits
map <m-,> <C-W>>
map <m-.> <C-W><
" F2 close current split (window)
noremap <F2> <Esc>:close<CR><Esc>
" Deleter buffer, keep the split (switch to prev buf, delete now prev buf)
nmap <leader>d :b#<bar>bd#<CR>
" ==================================================
" Tab navigation
" ==================================================
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove<CR>
nnoremap tn :tabnew<cr>
nnoremap th :tabfirst<CR>
nnoremap tk :tabnext<CR>
nnoremap tj :tabprev<CR>
nnoremap tl :tablast<CR>
" move tab to first position
nnoremap tF :tabm 0<CR>
nnoremap tL :tabm<CR>
" Navigate tabs with shift-{h,l}
noremap <S-l> gt
noremap <S-h> gT
" Let 'tl' toggle between this and the last accessed tab
let g:lasttab = 1
nmap <Leader>tl :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()
" Opens a new tab with the current buffer's path
" Super useful when editing files in the same directory
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
" Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
" Specify the behavior when switching between buffers
try
set switchbuf=useopen,usetab,newtab
set stal=2
catch
endtry
" ==================================================
" Buffer navigation
" ==================================================
nmap <A-Tab> :bnext<CR>
nmap <S-Tab> :bprevious<CR>
" ==================================================
" Clean all end of line whitespace with <Leader>S
" ==================================================
":nnoremap <silent><leader>S :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
fun! TrimWhitespace()
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
:nnoremap <silent><leader>S :call TrimWhitespace()<CR>
" ==================================================
" Visual mode related
" ==================================================
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
function! VisualSelection(direction, extra_filter) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", "\\/.*'$^~[]")
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'gv'
call CmdLine("Ack '" . l:pattern . "' " )
elseif a:direction == 'replace'
call CmdLine("%s" . '/'. l:pattern . '/')
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
" ==================================================
" Editing mappings
" ==================================================
" Remap VIM 0 to first non-blank character
map 0 ^
" Move a line of text using ALT+[jk] or Command+[jk] on mac
nmap <M-j> mz:m+<cr>`z
nmap <M-k> mz:m-2<cr>`z
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
if has("mac") || has("macunix")
nmap <D-j> <M-j>
nmap <D-k> <M-k>
vmap <D-j> <M-j>
vmap <D-k> <M-k>
endif
" ==================================================
" Spell checking
" ==================================================
" Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>
" Shortcuts using <leader>
map <leader>sn ]s
map <leader>sp [s
map <leader>sa zg
map <leader>s? z=
" ==================================================
" Other Configurations
" ==================================================
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" Quickly open a buffer for scribble
map <leader>q :e ~/buffer<cr>
" Quickly open a markdown buffer for scribble
map <leader>x :e ~/buffer.md<cr>
" Toggle paste mode on and off
map <leader>pp :setlocal paste!<cr>
noremap <C-p> :Denite buffer file_rec tag<CR>
xmap <leader>a gaip*
nmap <leader>t <C-w>s<C-w>j:terminal<CR>
nmap <leader>vt <C-w>v<C-w>l:terminal<CR>
nmap <leader>g :Goyo<CR>
nmap <leader>j :set filetype=journal<CR>
nmap <leader>l :Limelight!!<CR>
autocmd FileType python nmap <leader>x :0,$!~/.config/nvim/env/bin/python -m yapf<CR>
vmap <F2> !boxes -d stone
" surround by quotes - frequently use cases of vim-surround
map <leader>" ysiw"<cr>
map <leader>' ysiw'<cr>
" Act like D and C
nnoremap Y y$
" indent without kill the selection in vmode
vmap < <gv
vmap > >gv
" remap the annoying u in visual mode
vmap u y
" shortcut to substitute current word under cursor
nnoremap <leader>[ :%s/<c-r><c-w>//g<left><left>
" Change in next bracket
nmap cinb cib
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :<C-u>call general#VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
vnoremap <silent> # :<C-u>call general#VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
" delete character after cursor in insert mode
inoremap <C-d> <Del>
" highlight the line which is longer than the defined margin (120 character)
highlight MaxLineChar ctermbg=red
autocmd FileType php,js,vue,go call matchadd('MaxLineChar', '\%120v', 100)
" open devdocs.io with waterfox and search the word under the cursor
command! -nargs=? DevDocs :call system('type -p open >/dev/null 2>&1 && open https://devdocs.io/#q=<args> || waterfox -url https://devdocs.io/#q=<args>')
autocmd FileType python,ruby,rspec,javascript,go,html,php,eruby,coffee,haml nmap <buffer> <leader>D :exec "DevDocs " . fnameescape(expand('<cword>'))<CR>
" Markdown
autocmd BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
" Keep the cursor in place while joining lines
nnoremap J mzJ`z
" Quit neovim terminal
tnoremap <C-\> <C-\><C-n>
" Open images with feh
autocmd BufEnter *.png,*.jpg,*gif silent! exec "! feh ".expand("%") | :bw
" A |Dict| specifies the matcher for filtering and sorting the completion candidates.
let g:cm_matcher={'module': 'cm_matchers.abbrev_matcher', 'case': 'smartcase'}
" Disable anoying ex mode
nnoremap Q <Nop>
" Neovim :Terminal
tmap <Esc> <C-\><C-n>
tmap <C-w> <Esc><C-w>
autocmd BufWinEnter,WinEnter term://* startinsert
autocmd BufLeave term://* stopinsert
" vim:set et sw=2:
" ==================================================
" Right-to-Left (Hebrew etc) shortcuts
" ==================================================
" toggle direction mapping
" this is useful for logical-order editing
map <F9> :set invrl<CR>
" do it when in insert mode as well (and return to insert mode)
imap <F9> <Esc>:set invrl<CR>a
" toggle reverse insertion
" this is useful for visual-order editing
map <F8> :set invrevins<CR>
" do it when in insert mode as well (and return to insert mode)
imap <F8> <Esc>:set invrevins<CR>a
" vim:set et sw=2:
" ===================================================================
" FileType and Indentation settings
"
" Recommended: Don't rely on this, use editorconfig " in your project
" ===================================================================
" define less filetype
au BufNewFile,BufRead *.less set filetype=less
" make the smarty .tpl files html files for our purposes
au BufNewFile,BufRead *.tpl set filetype=html
" json
au! BufRead,BufNewFile *.json set filetype=json
" jquery
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
autocmd Filetype html setlocal ts=2 sw=2 expandtab
autocmd Filetype xhtml setlocal ts=2 sw=2 expandtab
autocmd Filetype xml setlocal ts=2 sw=2 expandtab
autocmd Filetype css setlocal ts=2 sw=2 expandtab
autocmd Filetype less setlocal ts=2 sw=2 expandtab
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab
autocmd Filetype javascript setlocal ts=4 sw=4 sts=0 noexpandtab
autocmd Filetype python setlocal omnifunc=jedi#completions tw=79
\ completeopt-=preview
\ formatoptions+=c
" HTML, XML, Jinja
autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType css setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType xml setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType htmldjango setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType htmldjango inoremap {{ {{ }}<left><left><left>
autocmd FileType htmldjango inoremap {% {% %}<left><left><left>
autocmd FileType htmldjango inoremap {# {# #}<left><left><left>
" LaTeX
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:vimtex_quickfix_mode=0
set conceallevel=1
let g:tex_conceal='abdmg'
" Markdown and Journal
autocmd FileType markdown setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType journal setlocal shiftwidth=2 tabstop=2 softtabstop=2
" Always assume .tex files are LaTeX
let g:tex_flavor = "latex"
" Don't autocomplete filenames that match these patterns
" Version control
set wildignore=.svn,.git
" Compiled formats
set wildignore+=*.o,*.pyc
" Images
set wildignore+=*.jpg,*.png,*.pdf
" Auxilary LaTeX files
set wildignore+=*.aux,*.bbl,*.blg,*.out,*.toc
" Web development
set wildignore+=vendor,_site,tmp,node_modules,bower_components
" Script outputs
set wildignore+=output
au BufNewFile,BufRead ~/.mutt/tmp/neomutt-* setlocal filetype=mail
" Makefiles require actual tabs
au FileType make setlocal noexpandtab
" Don't create backup files when editing crontabs
au filetype crontab setlocal nobackup nowritebackup
" Python style uses 4 spaces as tabs
au FileType python setlocal tabstop=4 shiftwidth=4
au BufNewFile,BufRead *.md setlocal filetype=markdown syntax=markdown
au BufNewFile,BufRead *.markdown setlocal syntax=markdown
" Spellchecking in LaTeX, Markdown
au FileType tex,plaintex,markdown setlocal spelllang=en_gb spell formatoptions=tcroqlj
" Wrap Python automatically at 80 characters
au FileType python setlocal textwidth=79 formatoptions=tcroqlj
" relativenumber can be very slow when combined with a language whose syntax
" highlighting regexs are complex
" https://github.com/neovim/neovim/issues/2401
" https://groups.google.com/forum/#!topic/vim_use/ebRiypE2Xuw
au FileType tex set norelativenumber
" Enable marker folder for Beancount files
au FileType beancount set foldmethod=marker foldlevel=0 foldlevelstart=0
" I often type `#` to start a comment, as alt-3, then hit space
" alt-space is a UTF non-breaking space character, which can give encoding errors
highlight UTFSpaceComment ctermfg=White ctermbg=1
au BufNewFile,BufRead * :syn match UTFSpaceComment '.\%uA0'
augroup mail
au!
au FileType mail setlocal spell spelllang=en_gb
" Common standard used in plaintext emails
au FileType mail setlocal textwidth=72
" w: Lines ending with spaces continue on the next line, used in combination
" with Mutt's text_flowed option
" a: Format automatically
" t: Wrap using textwidth
" c: Wrap comments using textwidth
" q: Format with gq macro
au FileType mail setlocal formatoptions=watcq
" Define comment leaders as in a Markdown document, that is:
" * Treat *, -, +, and > as comment leaders
" * Characters *, -, + begin comments when followed by a space, and wrapped
" lines immediately after these should be indented
" * Comments starting with > can be nested
au FileType mail setlocal comments=fb:*,fb:-,fb:+,n:>
" Install an autogroup that triggers when inside a `mail.*` syntax group
au FileType mail call OnSyntaxChange#Install('NoWrapElements', '^mail', 1, 'a')
" Use the trigger to disable/enable text wrapping when leaving/enter the
" mail body (i.e. we only want wrapping in the mail body).
au FileType mail autocmd User SyntaxNoWrapElementsEnterA setlocal formatoptions-=watc
au FileType mail autocmd User SyntaxNoWrapElementsLeaveA setlocal formatoptions+=watc
augroup end
" Twig
autocmd BufNewFile,BufRead *.twig set filetype=html.twig
" PHP
command! -nargs=1 Silent execute ':silent !'.<q-args> | execute ':redraw!'
map <c-s> <esc>:w<cr>:Silent php-cs-fixer fix %:p --level=symfony<cr>
" vim:set et sw=2:

View File

@@ -0,0 +1,31 @@
" As recommended by `:help provider`, define a venv just for neovim that has
" the neovim module and some Python linters
let g:python3_host_prog = expand('~/.config/nvim/env/bin/python')
" Enable nocompatible
if has('vim_starting')
" set default encoding to utf-8
" Let Vim use utf-8 internally, because many scripts require this
exe 'set encoding=utf-8'
scriptencoding utf-8
if &compatible
set nocompatible
endif
" python host
if !empty($PYTHON_HOST_PROG)
let g:python_host_prog = $PYTHON_HOST_PROG
endif
if !empty($PYTHON3_HOST_PROG)
let g:python3_host_prog = $PYTHON3_HOST_PROG
endif
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sections:
" -> Settings (01-settings)
" -> Theme (02-theme)
" -> Keymap (10-keymap-general, 11-keymap-rtl)
" -> File type specific (31-file-type.vim)
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

View File

@@ -0,0 +1,58 @@
" ==================================================
" COC configuration and mapping
" ==================================================
" Use `lp` and `ln` for navigate diagnostics
nmap <silent> <leader>lp <Plug>(coc-diagnostic-prev)
nmap <silent> <leader>ln <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> <leader>ld <Plug>(coc-definition)
nmap <silent> <leader>lt <Plug>(coc-type-definition)
nmap <silent> <leader>li <Plug>(coc-implementation)
nmap <silent> <leader>lf <Plug>(coc-references)
" Remap for rename current word
nmap <leader>lr <Plug>(coc-rename)
" Use K for show documentation in preview window
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if &filetype == 'vim'
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Coc extensions
let g:coc_global_extensions = [
\ 'coc-emoji',
\ 'coc-diagnostic',
\ 'coc-pairs',
\ 'coc-ultisnips',
\ 'coc-css',
\ 'coc-html',
\ 'coc-java',
\ 'coc-tsserver',
\ 'coc-vimtex',
\ 'coc-yaml',
\ 'coc-json',
\]
" \ 'coc-highlight',
" \ 'coc-dictionary',
" \ 'coc-syntax',
" outliner
let g:vista_default_executive = 'coc'
let g:vista#renderer#enable_icon = 0
" nnoremap <leader>o :Vista!!<CR>
" Coc Pairs
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
autocmd FileType tex let b:coc_pairs = [["$", "$"]]
autocmd FileType markdown let b:coc_pairs_disabled = ['`']
" vim:set et sw=2:

View File

@@ -0,0 +1,22 @@
{
"diagnostic-languageserver.filetypes": {
// lint `sh` (includes `bash`) files
"sh": "shellcheck"
},
"diagnostic-languageserver.formatFiletypes": {
// format `sh` (includes `bash`) files using formatter defined below
"sh": "shfmt"
},
"diagnostic-languageserver.formatters": {
// define our formatter so that we can reference it from
// `diagnostic-languageserver.formatFiletypes`
"shfmt": {
"command": "shfmt",
// all the below args are entirely optional
// primarily listed here to call out that flags which take an
// argument (such as `-i <num-spaces>` for specifying indentation)
// should be split into two strings, the flag and then the value
"args": ["-i", "2", "-bn", "-ci", "-sr"]
}
},
}

View File

@@ -0,0 +1,257 @@
diff --git a/neovim/.config/nvim/rc.d/00-plugins.vim b/neovim/.config/nvim/rc.d/00-plugins.vim
index a66b51d..ba57bc6 100644
--- a/neovim/.config/nvim/rc.d/00-plugins.vim
+++ b/neovim/.config/nvim/rc.d/00-plugins.vim
@@ -87,7 +87,6 @@ Plug 'majutsushi/tagbar'
Plug 'liuchengxu/vista.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'vim-scripts/Shebang'
-Plug 'w0rp/ale'
Plug 'sirver/ultisnips'
Plug 'honza/vim-snippets'
Plug 'Valloric/MatchTagAlways'
@@ -152,7 +151,6 @@ Plug 'vim-scripts/po.vim--Jelenak'
" PHP Support
Plug 'phpactor/phpactor' , {'do': 'composer install', 'for': 'php'}
-Plug 'kristijanhusak/deoplete-phpactor'
Plug 'vim-php/tagbar-phpctags.vim'
Plug 'tobyS/pdv'
Plug 'StanAngeloff/php.vim'
@@ -191,6 +189,8 @@ Plug 'lumiliet/vim-twig', {'for': 'twig'}
" javascript plugins
Plug 'pangloss/vim-javascript'
+Plug 'ternjs/tern_for_vim', { 'for': ['javascript', 'javascript.jsx', 'vue'], 'do': 'npm install'}
+
Plug 'leafgarland/typescript-vim'
" For react
@@ -200,19 +200,12 @@ Plug 'mxw/vim-jsx'
Plug 'posva/vim-vue'
" Autocomplete
-Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
-Plug 'zchee/deoplete-clang'
-Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' }
-Plug 'wokalski/autocomplete-flow'
-Plug 'sebastianmarkow/deoplete-rust'
-Plug 'shougo/neoinclude.vim'
-Plug 'zchee/deoplete-jedi'
-Plug 'shougo/neco-vim'
+Plug 'neoclide/coc.nvim', {'branch': 'release', 'do': { -> coc#util#install()}}
+Plug 'neoclide/coc-neco'
Plug 'othree/csscomplete.vim'
Plug 'othree/html5.vim'
Plug 'othree/xml.vim'
Plug 'c9s/perlomni.vim'
-Plug 'artur-shaik/vim-javacomplete2'
" CSV plugin
diff --git a/neovim/.config/nvim/rc.d/20-ale.vim b/neovim/.config/nvim/rc.d/20-ale.vim
deleted file mode 100644
index d513954..0000000
--- a/neovim/.config/nvim/rc.d/20-ale.vim
+++ /dev/null
@@ -1,68 +0,0 @@
-" ===================================================================
-" ale (Asynchronous Lint Engine) settings
-" ===================================================================
-
-" Syntax / File Support
-"" Enable JSDoc syntax highlighting
-let g:javascript_plugin_jsdoc = 1
-
-"" Add an error indicator to Ale
-let g:ale_sign_column_always = 1
-
-function! LinterStatus() abort
- let l:counts = ale#statusline#Count(bufnr(''))
-
- let l:all_errors = l:counts.error + l:counts.style_error
- let l:all_non_errors = l:counts.total - l:all_errors
-
- return l:counts.total == 0 ? 'OK' : printf(
- \ '%dW %dE',
- \ all_non_errors,
- \ all_errors
- \)
-endfunction
-
-set statusline=%{LinterStatus()}
-
-nmap <silent> <leader>e <Plug>(ale_next_wrap)
-nmap <silent> <leader>q <Plug>(ale_previous_wrap)
-
-" Ale
-let g:ale_lint_on_enter = 0
-let g:ale_lint_on_text_changed = 'never'
-let g:ale_echo_msg_error_str = 'E'
-let g:ale_echo_msg_warning_str = 'W'
-let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
-let g:ale_open_list = 1
-let g:ale_keep_list_window_open=0
-let g:ale_set_quickfix=0
-let g:ale_list_window_size = 5
-let g:ale_linters = {'python': ['flake8']}
-let g:ale_sign_error = '✖'
-let g:ale_sign_warning = '⚠'
-let g:ale_fixers = {
- \ '*': ['remove_trailing_lines', 'trim_whitespace'],
- \}
-" \ 'php': ['phpcbf', 'php_cs_fixer', 'remove_trailing_lines', 'trim_whitespace'],
-let g:ale_fix_on_save = 1
-
-" Use system flake8
-let g:ale_python_flake8_executable = '/usr/bin/flake8'
-
-" Append our Neovim virtualenv to the list of venvs ale searches for
-" The search is performed from the buffer directory up, until a name match is
-" found; our Neovim venv lives in ~/.nvim-venv
-let g:ale_virtualenv_dir_names = ['.env', '.venv', 'env', 'virtualenv', 'venv', '.nvim-venv']
-" Explicitly list linters we care about
-let g:ale_linters = {'python': ['flake8', 'pylint']}
-" Only show warnings and errors from pylint
-let g:ale_python_pylint_options = '--disable C,R'
-let g:ale_sign_warning = '→'
-let g:ale_sign_error = '→'
-
-" PHP Support
-let g:ale_php_phpcbf_standard='PSR2'
-let g:ale_php_phpcs_standard='phpcs.xml.dist'
-let g:ale_php_phpmd_ruleset='phpmd.xml'
-
-" vim:set et sw=2:
diff --git a/neovim/.config/nvim/rc.d/20-coc.vim b/neovim/.config/nvim/rc.d/20-coc.vim
new file mode 100644
index 0000000..dfad4a0
--- /dev/null
+++ b/neovim/.config/nvim/rc.d/20-coc.vim
@@ -0,0 +1,57 @@
+" ==================================================
+" COC configuration and mapping
+" ==================================================
+
+" Use `lp` and `ln` for navigate diagnostics
+nmap <silent> <leader>lp <Plug>(coc-diagnostic-prev)
+nmap <silent> <leader>ln <Plug>(coc-diagnostic-next)
+
+" Remap keys for gotos
+nmap <silent> <leader>ld <Plug>(coc-definition)
+nmap <silent> <leader>lt <Plug>(coc-type-definition)
+nmap <silent> <leader>li <Plug>(coc-implementation)
+nmap <silent> <leader>lf <Plug>(coc-references)
+
+" Remap for rename current word
+nmap <leader>lr <Plug>(coc-rename)
+
+" Use K for show documentation in preview window
+nnoremap <silent> K :call <SID>show_documentation()<CR>
+
+function! s:show_documentation()
+ if &filetype == 'vim'
+ execute 'h '.expand('<cword>')
+ else
+ call CocAction('doHover')
+ endif
+endfunction
+
+" Coc extensions
+let g:coc_global_extensions = [
+ \ 'coc-json',
+ \ 'coc-css',
+ \ 'coc-tsserver',
+ \ 'coc-emoji',
+ \ 'coc-html',
+ \ 'coc-ultisnips',
+ \ 'coc-yaml',
+ \ 'coc-pairs',
+ \ 'coc-java',
+ \ 'coc-vimtex'
+ \]
+
+" \ 'coc-highlight',
+" \ 'coc-dictionary',
+" \ 'coc-syntax',
+
+" outliner
+let g:vista_default_executive = 'coc'
+let g:vista#renderer#enable_icon = 0
+" nnoremap <leader>o :Vista!!<CR>
+
+" Coc Pairs
+inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
+autocmd FileType tex let b:coc_pairs = [["$", "$"]]
+autocmd FileType markdown let b:coc_pairs_disabled = ['`']
+
+" vim:set et sw=2:
diff --git a/neovim/.config/nvim/rc.d/20-deoplete.vim b/neovim/.config/nvim/rc.d/20-deoplete.vim
deleted file mode 100644
index 7138bab..0000000
--- a/neovim/.config/nvim/rc.d/20-deoplete.vim
+++ /dev/null
@@ -1,63 +0,0 @@
-" ===================================================================
-" Deoplete
-" ===================================================================
-
-" Autocomplete
-let g:deoplete#sources = {}
-let g:deoplete#sources.php = ['omni', 'phpactor', 'ultisnips', 'buffer']
-let g:deoplete#enable_at_startup = 1
-let g:deoplete#sources#jedi#statement_length = 50
-let g:deoplete#sources#jedi#enable_cache = 1
-let g:deoplete#sources#jedi#show_docstring = 0
-
-" disable autocomplete
-let g:deoplete#disable_auto_complete = 1
-if has("gui_running")
- inoremap <silent><expr><C-Space> deoplete#mappings#manual_complete()
-else
- inoremap <silent><expr><C-@> deoplete#mappings#manual_complete()
-endif
-
-" deoplete + neosnippet + autopairs changes
-let g:AutoPairsMapCR=0
-let g:deoplete#auto_complete_start_length = 1
-let g:deoplete#enable_at_startup = 1
-let g:deoplete#enable_smart_case = 1
-
-"" Deoplete per-autocompleter settings
-""" Clang
-let g:deoplete#sources#clang#libclang_path = '/lib/libclang.so' " '/usr/lib/i386-linux-gnu/libclang-4.0.so.1'
-let g:deoplete#sources#clang#clang_header = '/lib/clang/4.0.0/include' " '/usr/lib/llvm-4.0/lib/clang/4.0.0/include'
-
-""" TernJS
-let g:tern_request_timeout = 1
-" let g:tern_show_signature_in_pum = '0'
-let g:deoplete#sources#ternjs#depths = 1
-let g:deoplete#sources#ternjs#types = 1
-let g:deoplete#sources#ternjs#docs = 1
-let g:tern#command = ["tern"]
-let g:tern#arguments = ["--persistent"]
-
-""" Java
-autocmd FileType java setlocal omnifunc=javacomplete#Complete
-
-""" Omnifunctions
-let g:deoplete#omni#functions = {}
-
-let g:EclimCompletionMethod = 'omnifunc'
-let g:deoplete#omni#functions.java = 'eclim#java#complete#CodeComplete'
-
-let g:deoplete#omni#functions.javascript = [
- \ 'tern#Complete',
- \ 'autocomplete_flow#Complete',
- \ 'javascriptcomplete#CompleteJS'
- \]
-let g:deoplete#omni#functions.css = 'csscomplete#CompleteCSS'
-let g:deoplete#omni#functions.html = [
- \ 'htmlcomplete#CompleteTags',
- \ 'xmlcomplete#CompleteTags'
- \]
-let g:deoplete#omni#functions.xml = 'xmlcomplete#CompleteTags'
-let g:deoplete#omni#functions.perl = 'perlomni#PerlComplete'
-
-" vim:set et sw=2:

View File

@@ -0,0 +1,25 @@
se vi+=n~/.cache/vim/viminfo
sy on
se sw=4 ts=8 sts=-1 et nu sc hls title bg=dark swb=useopen
filet plugin indent on
comp gcc
au FileType make setl noet sw=8 sts=0
au FileType yaml setl indk=
packadd! matchit
au Filetype c nn <buffer> <F9> :!gcc "%" -o "%<" -std=c11 -O2 -g
\ -fsanitize=undefined -Wall -Wextra -Wshadow
\ -DJOHNCHEN902=1 <CR>
au Filetype cpp nn <buffer> <F9> :!g++ "%" -o "%<" -std=c++17 -O2 -g
\ -fsanitize=undefined -Wall -Wextra -Wshadow
\ -DJOHNCHEN902=1 <CR>
au Filetype haskell nn <buffer> <F9> :!ghc "%" -o "%<" -O -g
\ -dynamic -no-keep-hi-files -no-keep-o-files
\ -Wall <CR>
au Filetype rust nn <buffer> <F9> :!rustc "%" -o "%<" -O -g
\ -C prefer-dynamic <CR>
au Filetype c,cpp,haskell,rust nn <F5> :!"%:p:r" <CR>
au Filetype c,cpp,haskell,rust nn <F6> :!"%:p:r" < input.txt<CR>

View File

@@ -0,0 +1,44 @@
" As recommended by `:help provider`, define a venv just for neovim that has
" the neovim module and some Python linters
let g:python3_host_prog = expand('~/.config/nvim/env/bin/python')
" Enable nocompatible
if has('vim_starting')
" set default encoding to utf-8
" Let Vim use utf-8 internally, because many scripts require this
exe 'set encoding=utf-8'
scriptencoding utf-8
if &compatible
set nocompatible
endif
" python host
if !empty($PYTHON_HOST_PROG)
let g:python_host_prog = $PYTHON_HOST_PROG
endif
if !empty($PYTHON3_HOST_PROG)
let g:python3_host_prog = $PYTHON3_HOST_PROG
endif
endif
" ==================================================
" Allow pre-definitions via ~/.config/nvim/before.vim
" ==================================================
if filereadable(expand("~/.config/nvim/before.vim"))
source ~/.config/nvim/before.vim
endif
" ==================================================
" Source the files ~/.config/nvim/rc.d/
" ==================================================
for f in split(glob('~/.config/nvim/rc.d/*.vim'), '\n')
exe 'source' f
endfor
" ==================================================
" Allow overrides via ~/.config/nvim/after.vim
" ==================================================
if filereadable(expand("~/.config/nvim/after.vim"))
source ~/.config/nvim/after.vim
endif
" vim:set et sw=2:

View File

@@ -0,0 +1,197 @@
My Neovim setup
===============
My Neovim IDE setup for Python, Go, Rust, HTML, CSS, Javascript, Typescript,
gettext and more.
Features
---------
* `init.vim` handling
* Incremental and smart case search.
* Sublime Text style multiple selections
* Trailing whitespace highlighting and cleaning shortcut
* Logical and Visual layout (for Right-To-Left lanaguegs) editing.
* Tabs expand to 4 spaces by default
* Remap `<Leader>` to `<SPACE>` and `jj` to `<ESC>`
* Highlight current row and color column 80
* 70+ language packs support
* Syntax checking
* Snippets
* Quotes, parens etc pair, surround
* Extended pair matching with %
* ASCII drawing
* Fuzzy file, buffer, mru, tag, etc finder
* VCS plugins (Fugitive, Lawrencium)
* Tab completion
* Commenting
Prerequisites
-------------
- Neovim and Neovim Python client.
- For faster search, [ripgrep](https://github.com/BurntSushi/ripgrep)
- For tags: [ctags](http://ctags.sourceforge.net)
- For devicons, a patched font, like the one from
[nerd-fonts](https://github.com/ryanoasis/nerd-fonts)
Usage
------------
The following commands will clone the repo, and install `vim-plug` plugin
manager:
mkdir -p ~/.config/nvim
git clone https://github.com/MeirKriheli/dotneovim.git ~/.config/nvim
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Install plugins from the command line:
nvim +PlugUpdate +qa
After that, [install the desired COC plugins or extensions](https://github.com/neoclide/coc.nvim).
Overrides
----------------
* `~/.config/nvim/before.vim`, if exists, is sourced before everything allowing
definitions of variables to act upon.
* `~/.config/nvim/after.vim` if exists, is sourced after all the files in
`~/.config/nvim/rc.d` allowing override of default settings (e.g: color
schemes, plugin configuration, etc.).
Go tags
----------
For CtrlPBufTag search in go files, make sure you have an updated version
of ``ctags`` (>=5.8) and put in your ``~/.ctags``::
--langdef=Go
--langmap=Go:.go
--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/f,func/
--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/v,var/
--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/t,type/
Rust tags
-------------------------
For Rust ctags to wok (e.g: TagBar), put in your ``~/.ctags``::
--langdef=Rust
--langmap=Rust:.rs
--regex-Rust=/^[ \t]*(#\[[^\]]\][ \t]*)*(pub[ \t]+)?(extern[ \t]+)?("[^"]+"[ \t]+)?(unsafe[ \t]+)?fn[ \t]+([a-zA-Z0-9_]+)/\6/f,functions,function definitions/
--regex-Rust=/^[ \t]*(pub[ \t]+)?type[ \t]+([a-zA-Z0-9_]+)/\2/T,types,type definitions/
--regex-Rust=/^[ \t]*(pub[ \t]+)?enum[ \t]+([a-zA-Z0-9_]+)/\2/g,enum,enumeration names/
--regex-Rust=/^[ \t]*(pub[ \t]+)?struct[ \t]+([a-zA-Z0-9_]+)/\2/s,structure names/
--regex-Rust=/^[ \t]*(pub[ \t]+)?mod[ \t]+([a-zA-Z0-9_]+)/\2/m,modules,module names/
--regex-Rust=/^[ \t]*(pub[ \t]+)?(static|const)[ \t]+(mut[ \t]+)?([a-zA-Z0-9_]+)/\4/c,consts,static constants/
--regex-Rust=/^[ \t]*(pub[ \t]+)?(unsafe[ \t]+)?trait[ \t]+([a-zA-Z0-9_]+)/\3/t,traits,traits/
--regex-Rust=/^[ \t]*(pub[ \t]+)?(unsafe[ \t]+)?impl([ \t\n]*<[^>]*>)?[ \t]+(([a-zA-Z0-9_:]+)[ \t]*(<[^>]*>)?[ \t]+(for)[ \t]+)?([a-zA-Z0-9_]+)/\5 \7 \8/i,impls,trait implementations/
--regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/d,macros,macro definitions/
Plugins
------------
* [Solarized](https://github.com/altercation/vim-colors-solarized) - color
scheme
* [base16-vim](https://github.com/chriskempson/base16-vim) - color scheme
* [vim-molokai](https://github.com/tomasr/molokai) - color scheme
* [Oceanic-next](https://github.com/mhartington/oceanic-next) - color scheme
* [Nord VIM](https://github.com/arcticicestudio/nord-vim) - color scheme
* [Gruvbox](https://github.com/morhetz/gruvbox) - color scheme
* [Fugitive](https://github.com/tpope/vim-fugitive) - a Git wrapper so awesome,
it should be illegal
* [gv.vim](https://github.com/junegunn/gv.vim) - A git commit browser in Vim
* [Lawrencium](https://github.com/ludovicchabant/vim-lawrencium) - Mercurial
wrapper for Vim, inspired by Tim Pope's Fugitive
* [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) - Fuzzy file, buffer, mru,
tag, etc finder
* [ale](https://github.com/w0rp/ale) - Asynchronous Lint Engine
* [coc.nvim](https://github.com/neoclide/coc.nvim) - Intellisense engine for
vim8 & neovim, full language server protocol support as VSCode
* [UltiSnips](https://github.com/sirver/ultisnips) - The ultimate snippet
solution for Vim.
* [vim-snippets](https://github.com/honza/vim-snippets) - vim-snipmate default
snippets
* [python-mode](https://github.com/klen/python-mode) - Vim python-mode. PyLint,
Rope, Pydoc, breakpoints from box
* [vim-go](https://github.com/fatih/vim-go) - Go development plugin for Vim
* [rust.vim](https://github.com/rust-lang/rust.vim) - provides Rust file
detection, syntax highlighting, formatting, Syntastic integration, and more.
* [DrawIt](https://github.com/vim-scripts/DrawIt) - ASCII drawing plugin:
lines, ellipses, arrows, fills, and more!
* [vim-surround](https://github.com/tpope/vim-surround) -
quoting/parenthesizing made simple
* [Shebang](https://github.com/vim-scripts/Shebang) - Make executable by
setting the correct shebang and executable bit
* [Tagbar](http://majutsushi.github.com/tagbar/) - Displays tags in a window,
ordered by class etc.
* [NERD tree](https://github.com/scrooloose/nerdtree) - A tree explorer
* [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin) - A
plugin of NERDTree showing git status
* [auto-pairs](https://github.com/jiangmiao/auto-pairs) - Insert or delete
brackets, parens, quotes in pair
* [po.vim](http://vim.sourceforge.net/scripts/script.php?script_id=695) -
Easier editing of GNU gettext PO files
* [MatchTagAlways](https://github.com/valloric/MatchTagAlways) - A Vim plugin
that always highlights the enclosing html/xml tags
* [vim-airline](https://github.com/bling/vim-airline) - Light weight status
line utility
* [tabular](https://github.com/godlygeek/tabular) - text filtering and
alignment
* [tcomment_vim](https://github.com/tomtom/tcomment_vim) - An extensible &
universal comment vim-plugin that also handles embedded filetypes
* [vim-unimpaired](https://github.com/tpope/vim-unimpaired) - pairs of handy
bracket mappings
* [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) -
True Sublime Text style multiple selections for Vim
* [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim) - A Vim plugin
that simplifies the transition between multiline and single-line code
* [vim-repeat](https://github.com/tpope/vim-repeat) - enable repeating supported plugin maps with "."
* [tsuquyomi](https://github.com/Quramy/tsuquyomi) - A Vim plugin for TypeScript
* [vim-highlightedyank](https://github.com/machakann/vim-highlightedyank) - Make the yanked region apparent!
Shortcuts and re-Mappings
----------------------------
| Key | Command |
| ---------------------- | ----------------------------------------------------------------- |
| ``jj`` | ``<Esc>`` in insert and command modes |
| ``<SPACE>`` | ``<Leader>`` |
| ``<Leader>v`` | Load `.vimrc` |
| ``<Leader>V`` | Activate changes to `.vimrc` (Make sure to save it before) |
| ``<F2>`` | Close current split (window) |
| ``<F3>`` | Toggle NERD tree |
| ``<F5>`` | Toggle Tagbar |
| ``<Leader>S`` | Remove trailing whitespace |
| ``<CTRL>hjkl`` | Window movement commands |
| ``<CTRL>arrow`` | Window movement commands |
| ``<Leader>d`` | Delete buffer, keep the split |
| ``-``, ``+`` | Resize horizontal splits |
| ``<ALT><`` ``<ALT>>`` | Resize vertical splits |
| ``<F9>`` | Toggle logical (RTL, e.g: Hebrew) editing |
| ``<F8>`` | Toggle visual (RTL, e.g: Hebrew) editing |
| ``g/`` | :grep!<Space> |
| ``g*`` | :grep! -w current_word |
| ``ga`` | :grepadd! (add results to the current search) |
| ``gr`` | :CtrlPBufTag (fuzzy tag search in current file) |
Virtualenv settings
-------------------
If you're running from virtualenv activated, make sure to point nvim and ale to
correct locations. By default, settings are:
let g:python3_host_prog = '/usr/bin/python'
let g:ale_python_flake8_executable = '/usr/bin/flake8'
If needed, override those settings to the locations on your machine.

View File

@@ -0,0 +1,50 @@
#!/bin/sh
set -e
# Install nvim
sudo apt remove vim-tiny vim
sudo apt install neovim fzf silversearcher-ag tmux zathura latexmk
# Make config directory for Neovim's init.vim
echo '[*] Preparing Neovim config directory ...'
mkdir -p ~/.config/nvim
# Make nvim_runtime directory
mkdir -p ~/.nvim_runtime
mkdir -p ~/.nvim_runtime/temp_dirs
mkdir -p ~/.nvim_runtime/temp_dirs/swap
mkdir -p ~/.nvim_runtime/temp_dirs/backup
mkdir -p ~/.nvim_runtime/temp_dirs/undodir
mkdir -p ~/.nvim_runtime/temp_dirs/tags
mkdir -p ~/.nvim_runtime/sessions
# Install nvim (and its dependencies: pip3, git), Python 3 and ctags (for tagbar)
echo '[*] App installing Neovim and its dependencies (Python 3 and git), and dependencies for tagbar (exuberant-ctags) ...'
sudo apt update
sudo apt install -y curl neovim python3 python3-pip git exuberant-ctags global #npm
# Install virtualenv to containerize dependencies
echo '[*] Pip installing virtualenv to containerize Neovim dependencies (instead of installing them onto your system) ...'
python3 -m pip install virtualenv
python3 -m virtualenv -p python3 ~/.config/nvim/env
# Install pip modules for Neovim within the virtual environment created
echo '[*] Activating virtualenv and pip installing Neovim (for Python plugin support), libraries for async autocompletion support (jedi, psutil, setproctitle), and library for pep8-style formatting (yapf) ...'
. "${HOME}/.config/nvim/env/bin/activate"
pip3 install neovim pynvim jedi psutil setproctitle yapf
deactivate
# Install vim-plug plugin manager
echo '[*] Downloading vim-plug, the best minimalistic vim plugin manager ...'
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# (Optional but recommended) Install a nerd font for icons and a beautiful lightline bar (https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts)
echo "[*] Downloading patch font into ~/.local/share/fonts ..."
curl -fLo ~/.local/share/fonts/Iosevka\ Term\ Nerd\ Font\ Complete.ttf --create-dirs https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Iosevka/Regular/complete/Iosevka%20Term%20Nerd%20Font%20Complete.ttf
# Enter Neovim and install plugins using a temporary init.vim, which avoids warnings about missing colorschemes, functions, etc
echo '[*] Running :PlugInstall within nvim ...'
nvim +PlugInstall +qa
echo "[+] Done, welcome to \\033[1m\\033[92mNeoVim\\033[0m! Try it by running: nvim."

View File

@@ -0,0 +1,24 @@
# Setup by linking .vimrc and initializing submodules
./install.sh
./patch_fonts.sh # To be performed once only
# Installing a plugin as a submodule
git submodule add http://github.com/[user]/[plugin] bundle/[plugin-name]
git add .
git commit -m "Installed [plugin] bundle as a submodule."
# Updating bundled submodule plugins
git submodule foreach git pull origin master
# or update each plugin manually
cd bundles/[plugin]
git pull
# Removing a plugin
git submodule deinit -f bundle/[plugin-name]
git rm -rf bundle/[plugin-name]
git add .
git commit -m "Removed [plugin] bundle"
# Pathogen with Submodules Guides
https://gist.github.com/romainl/9970697
http://vimcasts.org/episodes/synchronizing-plugins-with-git-submodules-and-pathogen/

View File

@@ -0,0 +1,42 @@
i - Insert Mode
Shift + a - Insert Mode - Append
o - Insert Mode - New Line After
Shift + Up/Down - Scrolling
:wq - Write and Quit
:e [file] - Edit Another File
gg - Goto First Line
G - Goto Last Line
u - Undo
Ctrl + r - Redo
. - Repeat Previous Command
/[word] - Search
n - Search - Next
Shift + n - Search - Previous
/[word], [edit], n, . - Search, modify, next search, repeat for next
:%s/old/new/g - Replace All
:[startline],[endline]s/old/new/g - Replace Between Lines
:%s/^/[word]/g - Append Word to Start of Every Line
:%s/$/[word]/g - Append Word to End of Every Line
Ctrl + w and v - Splitting Window Vertically
Ctrl + w and Shift + s - Splitting Window Horizontally
v - Visual Select
Shift + v - Visual Select - Line
Ctrl + v - Visual Select - Block
Shift + v and [number]> - Tab a Line Multiple Times
d - Delete/Cut
dd - Delete Current Line
d[number]d - Delete Multiple Lines
y - Yank/Copy
p - Paste
gg=G - Fix All Indentations
vi" - Select everything within double quotes
va" - Select everything within and including double quotes
vi"d - Delete everything within double quotes
vi"s - Delete everything within double quotes then go into insert mode

View File

@@ -0,0 +1,3 @@
#!/bin/zsh
cat basic_header.vim rc.d/{01-settings,02-theme,10-keymap-general,11-keymap-rtl,31-file-type}.vim > basic.vim
sed -i 's/colorscheme minimalist/colorscheme desert/g' basic.vim

View File

@@ -0,0 +1,236 @@
" ==================================================
" vim-plug setup
" ==================================================
"
call plug#begin('~/.local/share/nvim/plugged')
" Color schemes and appearance
Plug 'frankier/neovim-colors-solarized-truecolor-only'
Plug 'chriskempson/base16-vim'
Plug 'drewtempelmeyer/palenight.vim'
"Plug 'kaicataldo/material.vim'
Plug 'dikiaap/minimalist'
" Appearance
Plug 'ryanoasis/vim-devicons'
Plug 'itchyny/lightline.vim'
Plug 'junegunn/limelight.vim'
Plug 'junegunn/goyo.vim'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'junegunn/vim-journal'
Plug 'luochen1990/rainbow'
Plug 'bling/vim-bufferline'
" easy way to rezise and exchange windows
Plug 'simeji/winresizer'
" General utilities
Plug 'ctrlpvim/ctrlp.vim'
Plug 'farmergreg/vim-lastplace'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind']}
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'ervandew/supertab'
Plug 'vim-scripts/DrawIt'
Plug 'terryma/vim-multiple-cursors'
Plug 'machakann/vim-highlightedyank'
Plug 'tpope/vim-repeat'
Plug 'junegunn/vim-easy-align'
Plug 'tpope/vim-abolish'
Plug 'Yggdroot/indentLine'
Plug 'chrisbra/Colorizer'
Plug 'heavenshell/vim-pydocstring'
Plug 'vim-scripts/loremipsum'
Plug 'metakirby5/codi.vim'
Plug 'dkarter/bullets.vim'
Plug 'wesQ3/vim-windowswap'
Plug 'benmills/vimux'
Plug 'schickling/vim-bufonly'
Plug 'shougo/echodoc.vim'
Plug 'tpope/vim-sleuth'
"Plug 'tpope/vim-unimpaired'
Plug 'shougo/denite.nvim'
Plug 'wincent/loupe'
Plug 'jez/vim-superman' " Open man with vim using vman (need to be configured in zsh boot)
Plug 'blueyed/vim-diminactive' " Plug to dim not-focused windows
Plug 'lambdalisue/suda.vim' " Write file with sudo
Plug 'junegunn/vim-peekaboo' " Display register values on " and @
Plug 'yangmillstheory/vim-snipe' " replace f F t T to target easily the motion
" undo tree
Plug 'simnalamburt/vim-mundo'
" registers
Plug 'bfredl/nvim-miniyank'
" close the current buffer
Plug 'moll/vim-bbye'
" Version control support
"
Plug 'tpope/vim-fugitive'
Plug 'mhinz/vim-signify'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'ludovicchabant/vim-lawrencium'
Plug 'junegunn/gv.vim'
" Programming support
Plug 'tpope/vim-commentary'
Plug 'majutsushi/tagbar'
Plug 'liuchengxu/vista.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'vim-scripts/Shebang'
Plug 'sirver/ultisnips'
Plug 'honza/vim-snippets'
Plug 'Valloric/MatchTagAlways'
Plug 'amiorin/vim-project'
Plug 'mhinz/vim-startify'
Plug 'AndrewRadev/splitjoin.vim' " Split arrays in PHP / struct in Go / other things
" Jump to definition
Plug 'ludovicchabant/vim-gutentags'
Plug 'skywind3000/gutentags_plus'
Plug 'skywind3000/vim-preview'
" fzf - poweful fuzzy finder
" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" Plug 'junegunn/fzf.vim'
source /usr/share/doc/fzf/examples/fzf.vim
" allow multisearch in current directory / multi replace as well
Plug 'wincent/ferret'
" Generic Programming Support
Plug 'tobyS/vmustache'
Plug 'janko-m/vim-test'
Plug 'maksimr/vim-jsbeautify'
Plug 'HiPhish/repl.nvim'
Plug 'ap/vim-css-color'
Plug 'hail2u/vim-css3-syntax'
Plug 'cakebaker/scss-syntax.vim'
Plug 'vim-scripts/Fold-license'
Plug 'neomake/neomake'
Plug 'joonty/vdebug'
Plug 'ap/vim-css-color' " display the hexadecimal colors - useful for css and color config
" Polyglot
Plug 'sheerun/vim-polyglot'
Plug 'cespare/vim-toml'
Plug 'chr4/nginx.vim'
Plug 'chr4/nginx.vim'
Plug 'chrisbra/csv.vim'
Plug 'derekwyatt/vim-scala'
Plug 'ekalinin/Dockerfile.vim'
Plug 'elixir-lang/vim-elixir'
Plug 'elzr/vim-json'
Plug 'ericpruitt/tmux.vim'
Plug 'fatih/vim-go', {'for': 'go'}
Plug 'HerringtonDarkholme/yats.vim'
Plug 'jparise/vim-graphql'
Plug 'JuliaEditorSupport/julia-vim'
Plug 'lambdatoast/elm.vim'
Plug 'lifepillar/pgsql.vim'
Plug 'lumiliet/vim-twig', {'for': 'twig'}
Plug 'maelvalais/gmpl.vim'
Plug 'mboughaba/i3config.vim'
Plug 'McSinyx/vim-octave'
Plug 'neovimhaskell/haskell-vim'
Plug 'ocaml/vim-ocaml'
Plug 'ocaml/vim-ocaml'
Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'posva/vim-vue'
Plug 'rust-lang/rust.vim'
Plug 'StanAngeloff/php.vim'
Plug 'stephpy/vim-yaml'
Plug 'sudar/vim-arduino-syntax'
Plug 'tbastos/vim-lua'
Plug 'tpope/vim-markdown'
Plug 'udalov/kotlin-vim'
Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' }
Plug 'vim-ruby/vim-ruby'
Plug 'vim-scripts/gnuplot-syntax-highlighting'
Plug 'vim-scripts/R.vim'
Plug 'vim-scripts/svg.vim'
Plug 'voldikss/vim-mma'
Plug 'wgwoods/vim-systemd-syntax'
Plug 'wlangstroth/vim-racket'
" emmet for html
Plug 'mattn/emmet-vim'
" Markdown / Writting
Plug 'reedes/vim-pencil'
Plug 'jtratner/vim-flavored-markdown'
" LaTeX
Plug 'lervag/vimtex'
" Programming languages
Plug 'bfrg/vim-cpp-modern'
Plug 'klen/python-mode'
Plug 'davidhalter/jedi-vim'
Plug 'racer-rust/vim-racer'
Plug 'Quramy/tsuquyomi'
Plug 'groenewege/vim-less'
Plug 'vim-scripts/po.vim--Jelenak'
" PHP Support
Plug 'phpactor/phpactor' , {'do': 'composer install', 'for': 'php'}
Plug 'vim-php/tagbar-phpctags.vim'
Plug 'tobyS/pdv'
Plug 'stephpy/vim-php-cs-fixer'
Plug 'adoy/vim-php-refactoring-toolbox'
Plug 'Rican7/php-doc-modded'
" Erlang Support
Plug 'vim-erlang/vim-erlang-tags'
Plug 'vim-erlang/vim-erlang-runtime'
Plug 'vim-erlang/vim-erlang-omnicomplete'
Plug 'vim-erlang/vim-erlang-compiler'
" Elixir Support
Plug 'avdgaag/vim-phoenix'
Plug 'mmorearty/elixir-ctags'
Plug 'mattreduce/vim-mix'
Plug 'BjRo/vim-extest'
Plug 'frost/vim-eh-docs'
Plug 'slashmili/alchemist.vim'
"Plug 'tpope/vim-endwise'
Plug 'jadercorrea/elixir_generator.vim'
Plug 'mhinz/vim-mix-format'
" golang development
Plug 'godoctor/godoctor.vim', {'for': 'go'} " refactoring
Plug 'sebdah/vim-delve', {'for': 'go'} " debugger
" javascript plugins
Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' }
Plug 'leafgarland/typescript-vim'
" For react
Plug 'mxw/vim-jsx'
" Smart Autocomplete
Plug 'w0rp/ale'
Plug 'kristijanhusak/deoplete-phpactor'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-clang'
Plug 'wokalski/autocomplete-flow'
Plug 'sebastianmarkow/deoplete-rust'
Plug 'shougo/neoinclude.vim'
Plug 'zchee/deoplete-jedi'
Plug 'shougo/neco-vim'
Plug 'othree/csscomplete.vim'
Plug 'othree/xml.vim'
Plug 'c9s/perlomni.vim'
Plug 'artur-shaik/vim-javacomplete2'
call plug#end()
" vim:set et sw=2:

View File

@@ -0,0 +1,222 @@
" ==================================================
" Basic Settings
" ==================================================
let mapleader="\<Space>" " Change the leader to be a space
set cmdheight=2 " Make command line two lines high
set scrolloff=7 " Set 7 lines to the cursor - when moving vertically using j/k
set sidescrolloff=5 " Have some context around the current line always on screen
set cursorline " Have a line indicate the cursor location (slow)
set autoindent " Always set autoindenting on
set smartindent " Set smart indent
set showcmd " Display incomplete commands
set ruler " Show the cursor position all the time
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%)
set number norelativenumber " Show line numbers
set ttyfast " Smoother changes
set modeline " Last lines in document sets vim mode
set shortmess=atIc " Abbreviate messages
set nostartofline " Don't jump to first character when paging
set backspace=indent,eol,start
set matchpairs+=<:> " Show matching <> (html mainly) as well
set showmatch " Show matching brackets when text indicator is over them
set matchtime=3 " How many tenths of a second to blink when matching brackets
set showmatch " Show matching braces, somewhat annoying...
set history=1000 " Sets how many lines of history VIM has to remember
set showmode " Show the default mode text (e.g. -- INSERT -- below the statusline)
set timeout ttimeoutlen=50
set updatetime=300 " Smaller updatetime for CursorHold & CursorHoldI
set signcolumn=yes
set whichwrap+=<,>,h,l,[,]
set fileformats=unix,dos,mac
set encoding=utf-8
set completeopt=longest,menuone " Preview mode causes flickering
set clipboard+=unnamedplus " Share the system clipboard
set splitright " Splits to the right
autocmd VimResized * wincmd = " Automatically equalize splits when Vim is resized
set wildmenu " show list instead of just completing
set wildmode=list:longest,full " command <Tab> completion, list matches, then longest common part, then all.
set completeopt=menu " Just show the menu upon completion (faster)
syntax on
set synmaxcol=200 " Syntax highlight only the first 200 chars"
filetype plugin on
filetype indent plugin on
set colorcolumn=80
"set colorcolumn=125 " Comfortable _and_ Github's line length
if has('linebreak') " Break indent wrapped lines
set breakindent
let &showbreak = '↳ '
set cpo+=n
end
" Linebreak on 500 characters
set lbr
set tw=80
" ==================================================
" Turn persistent undo on means that you can undo
" even when you close a buffer/VIM
" ==================================================
set directory=~/.nvim_runtime/temp_dirs/swap/
set backupdir=~/.nvim_runtime/temp_dirs/backup/
try
set undodir=~/.nvim_runtime/temp_dirs/undodir
set undofile
catch
endtry
" ==================================================
" Status line
" ==================================================
" Always show the status line
set laststatus=2
" Format the status line
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c
" Returns true if paste mode is enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
endif
return ''
endfunction
" ==================================================
" Use terminal title as an output
" ==================================================
set title
set titleold="Terminal"
set titlestring=%F
" ==================================================
" No annoying sound on errors
" ==================================================
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Properly disable sound on errors on MacVim
if has("gui_macvim")
autocmd GUIEnter * set vb t_vb=
endif
" ==================================================
" Tab expanded to 8 spaces
" ==================================================
set tabstop=8 " numbers of spaces of tab character
set shiftwidth=8 " numbers of spaces to (auto)indent
set expandtab " Tab to spaces by default
set softtabstop=8
set smarttab " Be smart when using tabs ;)
" ==================================================
" Search settings
" ==================================================
set hlsearch " highlight searches
set incsearch " do incremental searching
set ignorecase " ignore case when searching
set infercase " smarter completions that will be case aware when ignorecase is on
set smartcase " if searching and search contains upper case, make case sensitive search
set list listchars=trail,tab-
set fillchars+=vert:\
" ==================================================
" No modelines for security
" ==================================================
set modelines=0
set nomodeline
" ==================================================
" Trailing whitespace handling
" ==================================================
" Highlight end of line whitespace.
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/
" ==================================================
" Further settings
" ==================================================
" Try to display very long lines, rather than showing @
set display+=lastline
" show trailing whitespace as -, tabs as >-
set listchars=tab:>-,trail:-
set list
" Live substitution
set inccommand=split
if has("nvim")
set laststatus=1
endif
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
if has("win16") || has("win32")
set wildignore+=.git\*,.hg\*,.svn\*
else
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
endif
" Don't redraw while executing macros (good performance config)
set lazyredraw
" For regular expressions turn magic on
set magic
" when at 3 spaces, and I hit > ... go to 4, not 7
set shiftround
" number of undo saved in memory
set undolevels=10000 " How many undos
set undoreload=10000 " number of lines to save for undo
" set list
set list listchars=tab:\┆\ ,trail,nbsp
" doesn't prompt a warning when opening a file and the current file was written but not saved
set hidden
" no swap file! This is just annoying
set noswapfile
" Fold related
set foldlevelstart=0 " Start with all folds closed
" Set foldtext
set foldtext=general#FoldText()
" Show the substitution LIVE
set inccommand=nosplit
" for vertical pane in git diff tool
set diffopt+=vertical
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Set to auto read when a file is changed from the outside
set autoread
" indentLine
let g:indentLine_char = '▏'
let g:indentLine_color_gui = '#363949'
" vim:set et sw=2:

View File

@@ -0,0 +1,85 @@
" ==================================================
" Color scheme and fonts
" ==================================================
let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
let g:material_theme_style = 'palenight'
" disable the mouse - who needs a mouse??
set mouse-=a
set guicursor=
" Set font according to system
if has("mac") || has("macunix")
set gfn=IBM\ Plex\ Mono:h14,Hack:h14,Source\ Code\ Pro:h15,Menlo:h15
elseif has("win16") || has("win32")
set gfn=IBM\ Plex\ Mono:h14,Source\ Code\ Pro:h12,Bitstream\ Vera\ Sans\ Mono:h11
elseif has("gui_gtk2")
set gfn=IBM\ Plex\ Mono:h14,:Hack\ 14,Source\ Code\ Pro\ 12,Bitstream\ Vera\ Sans\ Mono\ 11
elseif has("linux")
set gfn=IBM\ Plex\ Mono:h14,:Hack\ 14,Source\ Code\ Pro\ 12,Bitstream\ Vera\ Sans\ Mono\ 11
elseif has("unix")
set gfn=Monospace\ 11
endif
" Disable scrollbars (real hackers don't use scrollbars for navigation!)
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
" Enable 256 colors palette in Gnome Terminal
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
set background=dark
"colorscheme material
set t_Co=256
colorscheme minimalist
hi Conceal guifg=#81A1C1 guibg=NONE ctermbg=NONE
let g:palenight_terminal_italics=1
let g:material_terminal_italics = 1
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
" Opaque Background (Comment out to use terminal's profile)
set termguicolors
endif
" Set extra options when running in GUI mode
if has("gui_running")
set guioptions-=T
set guioptions-=e
set t_Co=256
set guitablabel=%M\ %t
endif
highlight Pmenu guibg=white guifg=black gui=bold
highlight Comment gui=bold
highlight Normal gui=none
highlight NonText guibg=none
" Transparent Background (For i3 and compton)
highlight Normal guibg=NONE ctermbg=NONE
highlight LineNr guibg=NONE ctermbg=NONE
"" This will repair colors in Tmux.
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
"" Tmuxline
let g:tmuxline_theme = 'vim_statusline_3'
let g:tmuxline_preset = 'tmux'
"" Bufferline
let g:bufferline_echo = 0 " This will keep your messages from getting quickly hidden.
" vim:set et sw=2:

View File

@@ -0,0 +1,326 @@
" ==================================================
" Basic Mappings
" ==================================================
" Maps for jj to act as Esc in insert and command modes
ino jj <esc>
cno jj <c-c>
" One can map ctrl-c to something else if needed
map <c-c> <Nop>
imap <c-c> <Nop>
" Smarter j/k navigation
" Convert the j and k movement commands from strict linewise movements to
" onscreen display line movements via the gj and gk commands. When
" preceded with a count we want to go back to strict linewise movements.
" will automatically save movements larger than 5 lines to the jumplist.
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
" Center next/previous matched string
nnoremap n nzz
nnoremap N Nzz
" Save session
exec 'nnoremap <Leader>ss :mksession! ~/.nvim_runtime/sessions/*.vim<C-D><BS><BS><BS><BS><BS>'
" Reload session
exec 'nnoremap <Leader>sl :so ~/.nvim_runtime/sessions/*.vim<C-D><BS><BS><BS><BS><BS>'
" quick make
map <F6> :make<CR>
" simple pasting from the system clipboard
" http://tilvim.com/2014/03/18/a-better-paste.html
map <Leader>p :set paste<CR>o<esc>"+]p:set nopaste<cr>
" Quickly save, quit, or save-and-quit
map <leader>w :w<CR>
map <leader>x :x<CR>
map <leader>q :q<CR>
" un-highlight when esc is pressed
map <silent><esc> :noh<cr>
" Quickly toggle relative line numbers
function ToggleRelativeLineNumbers()
set invnumber
set invrelativenumber
endfunction
nnoremap <leader>l :call ToggleRelativeLineNumbers()<cr>
" Toggle between absolute -> relative line number
"nnoremap <C-n> :let [&nu, &rnu] = [&nu, &nu+&rnu==1]<CR>
" Save files as root
cnoremap w!! execute ':w suda://%'
" ==================================================
" vimrc handling
" ==================================================
" ,v loads .vimrc
" ,V reloads .vimrc -- activating changes (needs save)
map <leader>v :sp ~/.config/nvim/init.vim<CR><C-W>_
map <silent> <leader>V :source ~/.config/nvim/init.vim<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
" ==================================================
" Window navigation
" ==================================================
" control + vim direction key to navigate windows
noremap <C-J> <C-W>j
noremap <C-K> <C-W>k
noremap <C-H> <C-W>h
noremap <C-L> <C-W>l
" control + arrow key to navigate windows
noremap <C-Down> <C-W>j
noremap <C-Up> <C-W>k
noremap <C-Left> <C-W>h
noremap <C-Right> <C-W>l
" close all windows except the current one
nnoremap <leader>wco :only<cr>
nnoremap <leader>wcc :cclose<cr>
" windows creation
" create window on the bottom
nnoremap <leader>wb <c-w>s
" create vertival window
nnoremap <leader>wv <c-w>v
" " arrow keys resize windows
" nnoremap <Left> :vertical resize -10<CR>
" nnoremap <Right> :vertical resize +10<CR>
" nnoremap <Up> :resize -10<CR>
" nnoremap <Down> :resize +10<CR>
" imap <up> <nop>
" imap <down> <nop>
" imap <left> <nop>
" imap <right> <nop>
" ==================================================
" Splits handling
" ==================================================
" Make these all work in insert mode
imap <C-W> <C-O><C-W>
" - and + to resize horizontal splits
map - <C-W>-
map + <C-W>+
" alt-< or alt-> for vertical splits
map <m-,> <C-W>>
map <m-.> <C-W><
" F2 close current split (window)
noremap <F2> <Esc>:close<CR><Esc>
" Deleter buffer, keep the split (switch to prev buf, delete now prev buf)
nmap <leader>d :b#<bar>bd#<CR>
" ==================================================
" Tab navigation
" ==================================================
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove<CR>
nnoremap tn :tabnew<cr>
nnoremap th :tabfirst<CR>
nnoremap tk :tabnext<CR>
nnoremap tj :tabprev<CR>
nnoremap tl :tablast<CR>
" move tab to first position
nnoremap tF :tabm 0<CR>
nnoremap tL :tabm<CR>
" Navigate tabs with shift-{h,l}
noremap <S-l> gt
noremap <S-h> gT
" Let 'tl' toggle between this and the last accessed tab
let g:lasttab = 1
nmap <Leader>tl :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()
" Opens a new tab with the current buffer's path
" Super useful when editing files in the same directory
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
" Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
" Specify the behavior when switching between buffers
try
set switchbuf=useopen,usetab,newtab
set stal=2
catch
endtry
" ==================================================
" Buffer navigation
" ==================================================
nmap <A-Tab> :bnext<CR>
nmap <S-Tab> :bprevious<CR>
" ==================================================
" Clean all end of line whitespace with <Leader>S
" ==================================================
":nnoremap <silent><leader>S :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
fun! TrimWhitespace()
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
:nnoremap <silent><leader>S :call TrimWhitespace()<CR>
" ==================================================
" Visual mode related
" ==================================================
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
function! VisualSelection(direction, extra_filter) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", "\\/.*'$^~[]")
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'gv'
call CmdLine("Ack '" . l:pattern . "' " )
elseif a:direction == 'replace'
call CmdLine("%s" . '/'. l:pattern . '/')
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
" ==================================================
" Editing mappings
" ==================================================
" Remap VIM 0 to first non-blank character
map 0 ^
" Move a line of text using ALT+[jk] or Command+[jk] on mac
nmap <M-j> mz:m+<cr>`z
nmap <M-k> mz:m-2<cr>`z
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
if has("mac") || has("macunix")
nmap <D-j> <M-j>
nmap <D-k> <M-k>
vmap <D-j> <M-j>
vmap <D-k> <M-k>
endif
" ==================================================
" Spell checking
" ==================================================
" Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>
" Shortcuts using <leader>
map <leader>sn ]s
map <leader>sp [s
map <leader>sa zg
map <leader>s? z=
" ==================================================
" Other Configurations
" ==================================================
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" Quickly open a buffer for scribble
map <leader>q :e ~/buffer<cr>
" Quickly open a markdown buffer for scribble
map <leader>x :e ~/buffer.md<cr>
" Toggle paste mode on and off
map <leader>pp :setlocal paste!<cr>
noremap <C-p> :Denite buffer file_rec tag<CR>
xmap <leader>a gaip*
nmap <leader>t <C-w>s<C-w>j:terminal<CR>
nmap <leader>vt <C-w>v<C-w>l:terminal<CR>
nmap <leader>g :Goyo<CR>
nmap <leader>j :set filetype=journal<CR>
nmap <leader>l :Limelight!!<CR>
autocmd FileType python nmap <leader>x :0,$!~/.config/nvim/env/bin/python -m yapf<CR>
vmap <F2> !boxes -d stone
" surround by quotes - frequently use cases of vim-surround
map <leader>" ysiw"<cr>
map <leader>' ysiw'<cr>
" Act like D and C
nnoremap Y y$
" indent without kill the selection in vmode
vmap < <gv
vmap > >gv
" remap the annoying u in visual mode
vmap u y
" shortcut to substitute current word under cursor
nnoremap <leader>[ :%s/<c-r><c-w>//g<left><left>
" Change in next bracket
nmap cinb cib
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :<C-u>call general#VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
vnoremap <silent> # :<C-u>call general#VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
" delete character after cursor in insert mode
inoremap <C-d> <Del>
" highlight the line which is longer than the defined margin (120 character)
highlight MaxLineChar ctermbg=red
autocmd FileType php,js,vue,go call matchadd('MaxLineChar', '\%120v', 100)
" open devdocs.io with waterfox and search the word under the cursor
command! -nargs=? DevDocs :call system('type -p open >/dev/null 2>&1 && open https://devdocs.io/#q=<args> || waterfox -url https://devdocs.io/#q=<args>')
autocmd FileType python,ruby,rspec,javascript,go,html,php,eruby,coffee,haml nmap <buffer> <leader>D :exec "DevDocs " . fnameescape(expand('<cword>'))<CR>
" Markdown
autocmd BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
" Keep the cursor in place while joining lines
nnoremap J mzJ`z
" Quit neovim terminal
tnoremap <C-\> <C-\><C-n>
" Open images with feh
autocmd BufEnter *.png,*.jpg,*gif silent! exec "! feh ".expand("%") | :bw
" A |Dict| specifies the matcher for filtering and sorting the completion candidates.
let g:cm_matcher={'module': 'cm_matchers.abbrev_matcher', 'case': 'smartcase'}
" Disable anoying ex mode
nnoremap Q <Nop>
" Neovim :Terminal
tmap <Esc> <C-\><C-n>
tmap <C-w> <Esc><C-w>
autocmd BufWinEnter,WinEnter term://* startinsert
autocmd BufLeave term://* stopinsert
" vim:set et sw=2:

View File

@@ -0,0 +1,17 @@
" ==================================================
" Right-to-Left (Hebrew etc) shortcuts
" ==================================================
" toggle direction mapping
" this is useful for logical-order editing
map <F9> :set invrl<CR>
" do it when in insert mode as well (and return to insert mode)
imap <F9> <Esc>:set invrl<CR>a
" toggle reverse insertion
" this is useful for visual-order editing
map <F8> :set invrevins<CR>
" do it when in insert mode as well (and return to insert mode)
imap <F8> <Esc>:set invrevins<CR>a
" vim:set et sw=2:

View File

@@ -0,0 +1,68 @@
" ===================================================================
" ale (Asynchronous Lint Engine) settings
" ===================================================================
" Syntax / File Support
"" Enable JSDoc syntax highlighting
let g:javascript_plugin_jsdoc = 1
"" Add an error indicator to Ale
let g:ale_sign_column_always = 1
function! LinterStatus() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? 'OK' : printf(
\ '%dW %dE',
\ all_non_errors,
\ all_errors
\)
endfunction
set statusline=%{LinterStatus()}
nmap <silent> <leader>e <Plug>(ale_next_wrap)
nmap <silent> <leader>q <Plug>(ale_previous_wrap)
" Ale
let g:ale_lint_on_enter = 0
let g:ale_lint_on_text_changed = 'never'
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
let g:ale_open_list = 1
let g:ale_keep_list_window_open=0
let g:ale_set_quickfix=0
let g:ale_list_window_size = 5
let g:ale_linters = {'python': ['flake8']}
let g:ale_sign_error = '✖'
let g:ale_sign_warning = '⚠'
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\}
" \ 'php': ['phpcbf', 'php_cs_fixer', 'remove_trailing_lines', 'trim_whitespace'],
let g:ale_fix_on_save = 1
" Use system flake8
let g:ale_python_flake8_executable = '/usr/bin/flake8'
" Append our Neovim virtualenv to the list of venvs ale searches for
" The search is performed from the buffer directory up, until a name match is
" found; our Neovim venv lives in ~/.nvim-venv
let g:ale_virtualenv_dir_names = ['.env', '.venv', 'env', 'virtualenv', 'venv', '.nvim-venv']
" Explicitly list linters we care about
let g:ale_linters = {'python': ['flake8', 'pylint']}
" Only show warnings and errors from pylint
let g:ale_python_pylint_options = '--disable C,R'
let g:ale_sign_warning = '→'
let g:ale_sign_error = '→'
" PHP Support
let g:ale_php_phpcbf_standard='PSR2'
let g:ale_php_phpcs_standard='phpcs.xml.dist'
let g:ale_php_phpmd_ruleset='phpmd.xml'
" vim:set et sw=2:

View File

@@ -0,0 +1,48 @@
" ==================================================
" CtrlP
" ==================================================
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_custom_ignore = {
\ "dir": '\v[\/]\.(git|hg|svn)$',
\ "file": '\v\.(exe|so|dll|jpeg|jpg|png|gif)'
\ }
let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:15,results:30'
" ==================================================
" gr opens Fuzzy tags search
" ==================================================
nmap gr :CtrlPBufTag<CR>
let g:ctrlp_buftag_types = {
\ 'go' : '--language-force=go --golang-types=ftv',
\ 'coffee' : '--language-force=coffee --coffee-types=cmfvf',
\ 'markdown' : '--language-force=markdown --markdown-types=hik',
\ 'objc' : '--language-force=objc --objc-types=mpci',
\ 'rc' : '--language-force=rust --rust-types=fTm'
\ }
" ==================================================
" Use ag for ctrlp if available
" ==================================================
if executable('ag')
map <leader>f :Ag<Space>
" Use Ag over Grep
set grepprg="ag -i --nogroup --nocolor"
" Use Ag over Ack
let g:ackprg='ag -i --nogroup --nocolor --column'
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command='ag -i %s -l --nocolor -g ""'
endif
" ==================================================
" Use ripgrep for ctrlp if available
" ==================================================
if executable('rg')
set grepprg=rg\ --color=never
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
let g:ctrlp_use_caching = 0
endif
" vim:set et sw=2:

View File

@@ -0,0 +1,47 @@
" ===================================================================
" Deoplete
" ===================================================================
" Autocomplete
call deoplete#custom#option('sources', {'php' : ['omni', 'phpactor', 'ultisnips', 'buffer']})
let g:deoplete#enable_at_startup = 1
" disable autocomplete
let g:deoplete#disable_auto_complete = 1
if has("gui_running")
inoremap <silent><expr><C-Space> deoplete#mappings#manual_complete()
else
inoremap <silent><expr><C-@> deoplete#mappings#manual_complete()
endif
" deoplete + neosnippet + autopairs changes
let g:AutoPairsMapCR=0
call deoplete#custom#option('auto_complete_start_length', 1)
call deoplete#custom#option('enable_at_startup', 1)
call deoplete#custom#option('enable_smart_case', 1)
"" Deoplete per-autocompleter settings
""" Java
autocmd FileType java setlocal omnifunc=javacomplete#Complete
""" Omnifunctions
call deoplete#custom#var('omni', 'functions', {
\ 'java' : 'eclim#java#complete#CodeComplete',
\ 'javascript' : [
\ 'tern#Complete',
\ 'autocomplete_flow#Complete',
\ 'javascriptcomplete#CompleteJS'
\],
\ 'css' : ['csscomplete#CompleteCSS'],
\ 'html' : [
\ 'htmlcomplete#CompleteTags',
\ 'xmlcomplete#CompleteTags'
\],
\ 'xml' : ['xmlcomplete#CompleteTags'],
\ 'perl' : ['perlomni#PerlComplete'],
\})
let g:EclimCompletionMethod = 'omnifunc'
" vim:set et sw=2:

View File

@@ -0,0 +1,10 @@
" ==================================================
" Goyo
" ==================================================
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!
let g:limelight_conceal_ctermfg = 100
let g:limelight_conceal_guifg = '#83a598'
" vim:set et sw=2:

View File

@@ -0,0 +1,40 @@
" ==================================================
" Setup grep shortcuts and use ripgrep if available
" ==================================================
nmap g/ :grep!<space>
nmap g* :grep! -w <C-R><C-W><space>
nmap ga :grepadd!<space>
if executable("rg")
set grepprg=rg\ --vimgrep\ --no-heading
set grepformat=%f:%l:%c:%m,%f:%l:%m
endif
" Auto open grep quickfix window
autocmd QuickFixCmdPost *grep* cwindow
" Search from the git repo root, if we're in a repo, else the cwd
function FuzzyFind(show_hidden)
" Contains a null-byte that is stripped.
let gitparent=system('git rev-parse --show-toplevel')[:-2]
if a:show_hidden
let $FZF_DEFAULT_COMMAND = g:fzf_default_command . ' --hidden'
else
let $FZF_DEFAULT_COMMAND = g:fzf_default_command
endif
if empty(matchstr(gitparent, '^fatal:.*'))
silent execute ':FZF -m ' . gitparent
else
silent execute ':FZF -m .'
endif
endfunction
nnoremap <c-p> :call FuzzyFind(0)<cr>
nnoremap <c-i> :call FuzzyFind(1)<cr>
" Use rg to perform the search, so that .gitignore files and the like are
" respected
let g:fzf_default_command = 'rg --files'
" vim:set et sw=2:

View File

@@ -0,0 +1,11 @@
" ===================================================================
" Gutentags
" ===================================================================
" Jump to definition (if anyone knows how to make this work properly...)
let g:gutentags_modules = ['ctags', 'gtags_cscope']
let g:gutentags_project_root = ['.root', '.git']
let g:gutentags_plus_switch = 1
map <silent> <F12> :CtrlPTag<cr><c-\>w
" vim:set et sw=2:

View File

@@ -0,0 +1,16 @@
" ==================================================
" lightline
" ==================================================
let g:lightline = { 'colorscheme': 'material_vim' }
let g:lightline.active = {
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename','gitbranch', 'modified', 'neospinner'] ],
\ 'right': [ [ 'lineinfo' ], [ 'percent', 'wordcount', 'charcount' ], [ 'fileformat', 'fileencoding', 'filetype', 'charvaluehex' ] ]
\ }
let g:lightline.component = {
\ 'charvaluehex': '0x%B',
\ 'readonly': '%{&readonly?"⭤":""}'
\ }
let g:lightline.colorscheme = 'palenight'
" vim:set et sw=2:

View File

@@ -0,0 +1,216 @@
" +---------+
" | General |
" +---------+
" Neomake signs in the gutter
let g:neomake_error_sign = {'text': '', 'texthl': 'NeomakeErrorSign'}
let g:neomake_warning_sign = {
\ 'text': '',
\ 'texthl': 'NeomakeWarningSign',
\ }
let g:neomake_message_sign = {
\ 'text': '',
\ 'texthl': 'NeomakeWarningSign',
\ }
let g:neomake_info_sign = {'text': '', 'texthl': 'NeomakeInfoSign'}
" update neomake when save file
if isdirectory($HOME . "/nvim/plugged/neomake")
call neomake#configure#automake('w')
endif
" +-----+
" | PHP |
" +-----+
" standard phpcs config
let g:neomake_php_phpcs_args_standard = 'PSR2'
" display warning for phpcs error
function! SetWarningType(entry)
let a:entry.type = 'W'
endfunction
function! SetErrorType(entry)
let a:entry.type = 'E'
endfunction
function! SetMessageType(entry)
let a:entry.type = 'M'
endfunction
let g:neomake_php_enabled_makers = ['phpmd', 'phpcs', 'phpstan', 'php']
let g:neomake_php_phpcs_maker = {
\ 'args': ['--report=csv', '--standard=PSR2'],
\ 'errorformat':
\ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity%.%#,'.
\ '"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]%.%#',
\ 'postprocess': function('SetWarningType'),
\ }
let g:neomake_php_phpstan_maker = {
\ 'args': ['analyse', '--error-format', 'raw', '--no-progress', '--level', '7'],
\ 'errorformat': '%W%f:%l:%m',
\ 'postprocess': function('SetWarningType'),
\ }
let g:neomake_php_php_maker = {
\ 'args': ['-l', '-d', 'display_errors=1', '-d', 'log_errors=0',
\ '-d', 'xdebug.cli_color=0'],
\ 'errorformat':
\ '%-GNo syntax errors detected in%.%#,'.
\ '%EParse error: %#syntax error\, %m in %f on line %l,'.
\ '%EParse error: %m in %f on line %l,'.
\ '%EFatal error: %m in %f on line %l,'.
\ '%-G\s%#,'.
\ '%-GErrors parsing %.%#',
\ 'output_stream': 'stdout',
\ 'postprocess': function('SetErrorType'),
\ }
let g:neomake_php_phpmd_maker = {
\ 'args': ['%:p', 'text', 'cleancode,codesize,design,unusedcode,naming'],
\ 'errorformat': '%W%f:%l%\s%\s%#%m',
\ 'postprocess': function('SetMessageType'),
\ }
" +------------+
" | Javascript |
" +------------+
let g:neomake_javascript_enabled_makers = ['eslint']
" Use the fix option of eslint
let g:neomake_javascript_eslint_args = ['-f', 'compact', '--fix']
" Callback for reloading file in buffer when eslint has finished and maybe has
" autofixed some stuff
function! s:Neomake_callback(options)
if (a:options.name ==? 'eslint') && (a:options.has_next == 0)
" execute('checktime ' . bufname('%'))
execute('edit')
endif
endfunction
" Call neomake#Make directly instead of the Neomake provided command
autocmd BufWritePost *.js,*.jsx :silent :call neomake#Make(1, [], function('s:Neomake_callback'))
" +--------+
" | Golang |
" +--------+
let g:neomake_go_enabled_makers = [ 'go', 'golangcifast' ]
let g:neomake_go_golangci_maker = {
\ 'exe': 'golangci-lint',
\ 'args': [ 'run', '--enable=unparam' ],
\ 'append_file': 0,
\ 'cwd': '%:h',
\ 'postprocess': function('SetWarningType')
\ }
let g:neomake_go_golangcifast_maker = {
\ 'exe': 'golangci-lint',
\ 'args': [ 'run', '--fast', ],
\ 'append_file': 0,
\ 'cwd': '%:h',
\ 'postprocess': function('SetWarningType')
\ }
let g:neomake_go_gometalinter_maker = {
\ 'args': [
\ '--disable-all',
\ '--fast',
\ '--enable=deadcode',
\ '--enable=unparam',
\ '--enable=unused',
\ '--enable=errcheck',
\ ],
\ 'append_file': 0,
\ 'cwd': '%:h',
\ 'errorformat':
\ '%f:%l:%c:%t%*[^:]: %m,' .
\ '%f:%l::%t%*[^:]: %m',
\ 'postprocess': function('SetWarningType')
\ }
let g:go_fmt_options = {
\ 'gofmt': '-s',
\ }
nnoremap <leader>gg :Neomake<space>
autocmd FileType go nmap <buffer><leader>go :exec "Neomake golangci"<cr>
" +-----+
" | SQL |
" +-----+
let g:neomake_sql_enabled_makers = ['sqlint']
" +------+
" | YAML |
" +------+
let g:neomake_yaml_enabled_makers = [ 'yamllint' ]
" +---------------+
" | Racket (Lisp) |
" +---------------+
let g:neomake_scheme_enabled_makers = ['raco']
let g:neomake_scheme_raco_maker = {
\ 'exe': 'raco',
\ 'args': ['expand'],
\ 'errorformat': '%-G %.%#,%E%f:%l:%c: %m'
\ }
" Spinner??? OMG
let s:spinner_index = 0
let s:active_spinners = 0
let s:spinner_states = ['|', '/', '--', '\', '|', '/', '--', '\']
let s:spinner_states = ['┤', '┘', '┴', '└', '├', '┌', '┬', '┐']
let s:spinner_states = ['←', '↑', '→', '↓']
let s:spinner_states = ['d', 'q', 'p', 'b']
let s:spinner_states = ['■', '□', '▪', '▫', '▪', '□', '■']
let s:spinner_states = ['→', '↘', '↓', '↙', '←', '↖', '↑', '↗']
let s:spinner_states = ['.', 'o', 'O', '°', 'O', 'o', '.']
function! StartSpinner()
let b:show_spinner = 1
let s:active_spinners += 1
if s:active_spinners == 1
let s:spinner_timer = timer_start(1000 / len(s:spinner_states), 'SpinSpinner', {'repeat': -1})
endif
endfunction
function! StopSpinner()
let b:show_spinner = 0
let s:active_spinners -= 1
if s:active_spinners == 0
:call timer_stop(s:spinner_timer)
endif
endfunction
function! SpinSpinner(timer)
let s:spinner_index = float2nr(fmod(s:spinner_index + 1, len(s:spinner_states)))
redraw
endfunction
function! SpinnerText()
if get(b:, 'show_spinner', 0) == 0
return " "
endif
return s:spinner_states[s:spinner_index]
endfunction
augroup neomake_hooks
au!
autocmd User NeomakeJobInit :call StartSpinner()
autocmd User NeomakeFinished :call StopSpinner()
" autocmd User NeomakeFinished :echom "Build complete"
augroup END
" vim:set et sw=2:

View File

@@ -0,0 +1,11 @@
" ==================================================
" NERDTree
" ==================================================
let NERDTreeIgnore = ['\.pyc$', '\.pyo$']
map <F3> :NERDTreeToggle<CR>
let NERDTreeShowHidden=1
let g:NERDTreeDirArrowExpandable = '↠'
let g:NERDTreeDirArrowCollapsible = '↡'
" vim:set et sw=2:

View File

@@ -0,0 +1,9 @@
" ==================================================
" Pear Tree
" ==================================================
let g:pear_tree_smart_openers=1
let g:pear_tree_smart_closers=1
let g:pear_tree_smart_backspace=1
" vim:set et sw=2:

View File

@@ -0,0 +1,10 @@
" ==================================================
" PHP refactoring
" ==================================================
let g:vim_php_refactoring_default_property_visibility = 'private'
let g:vim_php_refactoring_default_method_visibility = 'private'
let g:vim_php_refactoring_auto_validate_visibility = 1
let g:vim_php_refactoring_phpdoc = "pdv#DocumentCurrentLine"
" vim:set et sw=2:

View File

@@ -0,0 +1,13 @@
" ==================================================
" Disable python-mode rope completion (using Jedi)
" Disable folding
" Don't trim whitespace on save
" ==================================================
let g:pymode_rope_completion = 0
let g:pymode_folding = 0
let g:pymode_rope = 0
let g:pymode_trim_whitespaces = 0
let g:pymode_lint = 0
let g:pymode_doc = 0
" vim:set et sw=2:

View File

@@ -0,0 +1,7 @@
" ==================================================
" SuperTab
" ==================================================
let g:SuperTabDefaultCompletionType = "<C-n>"
" vim:set et sw=2:

View File

@@ -0,0 +1,38 @@
" ==================================================
" Tagbar Mapping
" ==================================================
nmap <F5> :TagbarToggle<CR>
let g:tagbar_width = 30
let g:tagbar_iconchars = ['↠', '↡']
let g:tagbar_autofocus = 1
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : ['p:package', 'i:imports:1', 'c:constants', 'v:variables', 't:types', 'n:interfaces', 'w:fields', 'e:embedded', 'm:methods', 'r:constructor', 'f:functions'],
\ 'sro' : '.',
\ 'kind2scope' : {'t' : 'ctype', 'n' : 'ntype'},
\ 'scope2kind' : {'ctype' : 't', 'ntype' : 'n'},
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
let g:tagbar_type_rust = {
\ 'ctagstype' : 'rust',
\ 'kinds' : [
\'T:types,type definitions',
\'f:functions,function definitions',
\'g:enum,enumeration names',
\'s:structure names',
\'m:modules,module names',
\'c:consts,static constants',
\'t:traits',
\'i:impls,trait implementations',
\]
\}
" PHP Support
let g:tagbar_phpctags_bin='~/.local/bin/phpctags'
" vim:set et sw=2:

View File

@@ -0,0 +1,6 @@
" better key bindings for UltiSnipsExpandTrigger
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-j>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
" vim:set et sw=2:

View File

@@ -0,0 +1,29 @@
" Debug
if !exists('g:vdebug_options')
let g:vdebug_options = {}
endif
let g:vdebug_options['break_on_open'] = 0
let g:vdebug_options['watch_window_style'] = 'compact'
let g:vdebug_options["port"] = 9000
let g:vdebug_keymap = {
\ "run" : "<F5>",
\ "run_to_cursor" : "<F9>",
\ "step_over" : "<F2>",
\ "step_into" : "<F3>",
\ "step_out" : "<F4>",
\ "close" : "<F6>",
\ "detach" : "<F7>",
\ "set_breakpoint" : "<F10>",
\ "get_context" : "<F11>",
\ "eval_under_cursor" : "<F12>",
\ "eval_visual" : "<F8>",
\}
" map the project when used in a vagrant / vm | vm path : host past
let g:vdebug_options["path_maps"] = {
\}
" redefine the characters
autocmd VimEnter * sign define breakpt text=texthl=DbgBreakptSign linehl=DbgBreakptLine
autocmd VimEnter * sign define current text=texthl=DbgCurrentSign linehl=DbgCurrentLine
" vim:set et sw=2:

View File

@@ -0,0 +1,20 @@
" fatih/vim-go
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_structs = 1
let g:go_highlight_types = 1
let g:go_auto_sameids = 1
let g:go_fmt_command = "goimports"
let g:go_list_type = "quickfix"
let g:go_fmt_fail_silently = 1
let g:go_term_enabled = 0
let g:go_auto_type_info = 1
" vim:set et sw=2:

View File

@@ -0,0 +1,141 @@
" ===================================================================
" FileType and Indentation settings
"
" Recommended: Don't rely on this, use editorconfig " in your project
" ===================================================================
" define less filetype
au BufNewFile,BufRead *.less set filetype=less
" make the smarty .tpl files html files for our purposes
au BufNewFile,BufRead *.tpl set filetype=html
" json
au! BufRead,BufNewFile *.json set filetype=json
" jquery
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
autocmd Filetype html setlocal ts=2 sw=2 expandtab
autocmd Filetype xhtml setlocal ts=2 sw=2 expandtab
autocmd Filetype xml setlocal ts=2 sw=2 expandtab
autocmd Filetype css setlocal ts=2 sw=2 expandtab
autocmd Filetype less setlocal ts=2 sw=2 expandtab
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab
autocmd Filetype javascript setlocal ts=4 sw=4 sts=0 noexpandtab
autocmd Filetype python setlocal omnifunc=jedi#completions tw=79
\ completeopt-=preview
\ formatoptions+=c
" HTML, XML, Jinja
autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType css setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType xml setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType htmldjango setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType htmldjango inoremap {{ {{ }}<left><left><left>
autocmd FileType htmldjango inoremap {% {% %}<left><left><left>
autocmd FileType htmldjango inoremap {# {# #}<left><left><left>
" LaTeX
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:vimtex_quickfix_mode=0
set conceallevel=1
let g:tex_conceal='abdmg'
" Markdown and Journal
autocmd FileType markdown setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType journal setlocal shiftwidth=2 tabstop=2 softtabstop=2
" Always assume .tex files are LaTeX
let g:tex_flavor = "latex"
" Don't autocomplete filenames that match these patterns
" Version control
set wildignore=.svn,.git
" Compiled formats
set wildignore+=*.o,*.pyc
" Images
set wildignore+=*.jpg,*.png,*.pdf
" Auxilary LaTeX files
set wildignore+=*.aux,*.bbl,*.blg,*.out,*.toc
" Web development
set wildignore+=vendor,_site,tmp,node_modules,bower_components
" Script outputs
set wildignore+=output
au BufNewFile,BufRead ~/.mutt/tmp/neomutt-* setlocal filetype=mail
" Makefiles require actual tabs
au FileType make setlocal noexpandtab
" Don't create backup files when editing crontabs
au filetype crontab setlocal nobackup nowritebackup
" Python style uses 4 spaces as tabs
au FileType python setlocal tabstop=4 shiftwidth=4
au BufNewFile,BufRead *.md setlocal filetype=markdown syntax=markdown
au BufNewFile,BufRead *.markdown setlocal syntax=markdown
" Spellchecking in LaTeX, Markdown
au FileType tex,plaintex,markdown setlocal spelllang=en_gb spell formatoptions=tcroqlj
" Wrap Python automatically at 80 characters
au FileType python setlocal textwidth=79 formatoptions=tcroqlj
" relativenumber can be very slow when combined with a language whose syntax
" highlighting regexs are complex
" https://github.com/neovim/neovim/issues/2401
" https://groups.google.com/forum/#!topic/vim_use/ebRiypE2Xuw
au FileType tex set norelativenumber
" Enable marker folder for Beancount files
au FileType beancount set foldmethod=marker foldlevel=0 foldlevelstart=0
" I often type `#` to start a comment, as alt-3, then hit space
" alt-space is a UTF non-breaking space character, which can give encoding errors
highlight UTFSpaceComment ctermfg=White ctermbg=1
au BufNewFile,BufRead * :syn match UTFSpaceComment '.\%uA0'
augroup mail
au!
au FileType mail setlocal spell spelllang=en_gb
" Common standard used in plaintext emails
au FileType mail setlocal textwidth=72
" w: Lines ending with spaces continue on the next line, used in combination
" with Mutt's text_flowed option
" a: Format automatically
" t: Wrap using textwidth
" c: Wrap comments using textwidth
" q: Format with gq macro
au FileType mail setlocal formatoptions=watcq
" Define comment leaders as in a Markdown document, that is:
" * Treat *, -, +, and > as comment leaders
" * Characters *, -, + begin comments when followed by a space, and wrapped
" lines immediately after these should be indented
" * Comments starting with > can be nested
au FileType mail setlocal comments=fb:*,fb:-,fb:+,n:>
" Install an autogroup that triggers when inside a `mail.*` syntax group
au FileType mail call OnSyntaxChange#Install('NoWrapElements', '^mail', 1, 'a')
" Use the trigger to disable/enable text wrapping when leaving/enter the
" mail body (i.e. we only want wrapping in the mail body).
au FileType mail autocmd User SyntaxNoWrapElementsEnterA setlocal formatoptions-=watc
au FileType mail autocmd User SyntaxNoWrapElementsLeaveA setlocal formatoptions+=watc
augroup end
" Twig
autocmd BufNewFile,BufRead *.twig set filetype=html.twig
" PHP
command! -nargs=1 Silent execute ':silent !'.<q-args> | execute ':redraw!'
map <c-s> <esc>:w<cr>:Silent php-cs-fixer fix %:p --level=symfony<cr>
" vim:set et sw=2:

View File

@@ -0,0 +1,36 @@
" ==================================================
" Transparent editing of gpg encrypted files.
" ==================================================
"
augroup encrypted
au!
" First make sure nothing is written to ~/.viminfo while editing
" an encrypted file.
autocmd BufReadPre,FileReadPre *.gpg set viminfo=
" We don't want a swap file, as it writes unencrypted data to disk
autocmd BufReadPre,FileReadPre *.gpg set noswapfile
" Switch to binary mode to read the encrypted file
autocmd BufReadPre,FileReadPre *.gpg set bin
autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2
autocmd BufReadPre,FileReadPre *.gpg let shsave=&sh
autocmd BufReadPre,FileReadPre *.gpg let &sh='sh'
autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --decrypt --default-recipient-self 2> /dev/null
autocmd BufReadPost,FileReadPost *.gpg let &sh=shsave
" Switch to normal mode for editing
autocmd BufReadPost,FileReadPost *.gpg set nobin
autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save
autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r")
" Convert all text to encrypted text before writing
autocmd BufWritePre,FileWritePre *.gpg set bin
autocmd BufWritePre,FileWritePre *.gpg let shsave=&sh
autocmd BufWritePre,FileWritePre *.gpg let &sh='sh'
autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg --encrypt --default-recipient-self 2>/dev/null
autocmd BufWritePre,FileWritePre *.gpg let &sh=shsave
" Undo the encryption so we are back in the normal text, directly
" after the file has been written.
autocmd BufWritePost,FileWritePost *.gpg silent u
autocmd BufWritePost,FileWritePost *.gpg set nobin
augroup END
" vim:set et sw=2:

View File

@@ -0,0 +1,14 @@
set foldlevelstart=10 " open most folds by default
"
" ==================================================
" XML folding
" ==================================================
let g:xml_syntax_folding=1
au FileType xml setlocal foldmethod=syntax
" ==================================================
" JSON folding
" ==================================================
au FileType json setlocal foldmethod=syntax
" vim:set et sw=2:

View File

@@ -0,0 +1,37 @@
codebase
MySQL
mycli
config
Github
AUR
yay
Ubuntu
Debian
macOS
DSN
Youtube
Golang
RedBull
QBasic
backend
frontend
DevDash
cyclomatic
OOP
YAGNI
API
APIs
SRP
CQRS
JSON
gamification
refactor
YAML
CSS
DevOps
ripgrep
prefrontal
PHP
SEO
blog
screenshot

Binary file not shown.