Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
167 lines (139 sloc) 4.33 KB
let g:python_host_prog = '/home/ahal/.pyenv/shims/python'
call plug#begin('~/.nvim/plugged')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug 'vim-scripts/camelcasemotion'
Plug 'easymotion/vim-easymotion'
Plug 'neomake/neomake'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'Soares/base16.nvim'
Plug 'rust-lang/rust.vim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-jedi'
Plug 'carlitux/deoplete-ternjs', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'othree/yajs.vim'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
call plug#end()
"UI
set background=dark
set cursorcolumn
set ignorecase " ignore case when searching
set smartcase
set incsearch " incremental search
set hlsearch " hilight search items
set ruler " always show current position
set magic " for regexes
set number
set nowrap
set scrolloff=10
set showcmd
set showmatch " show matching brackets
set infercase
set title
set wildmenu
" Tabbing
set hidden
set expandtab
set shiftwidth=4
set tabstop=4
set smartcase
set smarttab
" Programs
set grepprg=rg\ --vimgrep
" Navigation Mappings
let mapleader = ";"
map <C-Left> :bprev<cr>
map <C-Right> :bnext<cr>
map <C-q> :bp<bar>sp<bar>bn<bar>bd<cr>
map <C-l> <C-w>l
map <C-k> <C-w>k
map <C-j> <C-w>j
map <C-h> <C-w>h
map <C-S-k> <C-y>
map <C-S-j> <C-e>
map <C-S-Left> :tabp<cr>
map <C-S-Right> :tabn<cr>
map <leader><leader> <C-^>
map _ k^
map + j^
map - k$
map = j$
" QuickFix
map <A-j> :cn<cr>
map <A-k> :cp<cr>
" Surround
map <C-s> ysiw
" File open mappings
cnoremap %% <C-R>=expand("%:p:h") . "/" <cr>
map <leader>n :e %%
" Colours
set termguicolors
colorscheme chalk
hi CursorColumn guibg=#404040
hi Search cterm=None ctermfg=red ctermbg=grey
hi Pmenu ctermfg=15 ctermbg=0 guifg=#ffffff guibg=#000000
" File Types
au BufRead,BufNewFile *.jsm set filetype=javascript
au BufRead,BufNewFile *.sjs set filetype=javascript
au BufRead,BufNewFile *.md set filetype=markdown
" Neomake
let g:neomake_open_list = 2
:nnoremap <silent> <F7> :Neomake<CR>
" deoplete
let g:deoplete#enable_at_startup = 1
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
inoremap <silent><expr><s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
" UltiSnips
let g:UltiSnipsExpandTrigger="<C-q>"
" CamelCaseMotion
map w <Plug>CamelCaseMotion_w
map b <Plug>CamelCaseMotion_b
map e <Plug>CamelCaseMotion_e
sunmap w
" EasyMotion
map <Leader> <Plug>(easymotion-prefix)
map <Leader>/ <Plug>(easymotion-sn)
omap <Leader>/ <Plug>(easymotion-tn)
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
let g:EasyMotion_startofline = 0
let g:EasyMotion_smartcase = 1
" AirLine
let g:airline#extensions#tabline#enabled = 0
let g:airline#extensions#tabline#show_tabs = 0
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline_theme='bubblegum'
let g:base16_airline=1
" FZF
function! s:find_moz_root()
return fnamemodify(findfile('moz.build', '.;'), ':h')
endfunction
command! -bang FilesDir call fzf#vim#files(expand('%:p:h'), <bang>0)
command! -bang FilesMozRoot call fzf#vim#files(s:find_moz_root(), <bang>0)
let findcmd = 'rg --column --line-number --no-heading --fixed-strings --ignore-case --ignore-file /home/ahal/.ignore --color "always" '
command! -bang -nargs=* Find call fzf#vim#grep(findcmd . shellescape(<q-args>), 1, <bang>0)
command! -bang -nargs=* FindMozRoot call fzf#vim#grep(findcmd . shellescape(<q-args>) . ' ' . shellescape(s:find_moz_root()), 1, <bang>0)
nmap <leader>w :Files<cr>
nmap <leader>e :Buffers<cr>
nmap <leader>r :FilesMozRoot<cr>
nmap <leader>t :FilesDir<cr>
nmap <leader>f :Find<cr>
nmap <leader>g :FindMozRoot<cr>
nmap <leader>c :Tags<cr>
" markdown-vim
" autocmd FileType markdown syn clear mkdLineBreak
autocmd FileType markdown setlocal spell! spelllang=en
autocmd FileType markdown setlocal textwidth=100
autocmd FileType markdown setlocal wrap
" Delete trailing whitespace on <F5>
:nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
" Spell check toggle
map <F6> :setlocal spell! spelllang=en_ca<CR> :setlocal textwidth=100<CR> :setlocal wrap<CR>
hi SpellBad ctermbg=060