dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

.vimrc (1424B)


      1 call plug#begin()
      2 
      3 Plug '/usr/local/opt/fzf'
      4 Plug 'junegunn/fzf.vim'
      5 
      6 Plug 'tpope/vim-obsession'
      7 Plug 'ledger/vim-ledger'
      8 
      9 call plug#end()
     10 
     11 let mapleader = ","
     12 
     13 " fzf remaps
     14 nmap ; :Buffers<CR>
     15 nmap <Leader>t :Files<CR>
     16 nmap <Leader>r :Rg<CR>
     17 nmap <Leader>m :Marks<CR>
     18 
     19 " Move between Vim panes
     20 nmap <Leader>h <C-W>h
     21 nmap <Leader>j <C-W>j
     22 nmap <Leader>k <C-W>k
     23 nmap <Leader>l <C-W>l
     24 
     25 " Save file with cs
     26 nmap cs :w<CR>
     27 " Remap escape to jj
     28 imap jj <Esc>
     29 
     30 set noswapfile     " Disable swap files
     31 syntax on          " Turn on syntax highlighting
     32 set number         " Enable line numbers
     33 set relativenumber " Current line shows absolute line number
     34 set ruler          " Show row and column information
     35 set hlsearch       " Enable highlight on search
     36 set hidden         " Hide buffers instead of abandoning them
     37 
     38 set autoindent
     39 set expandtab      " Expand tabs to spaces
     40 set tabstop=4
     41 set shiftwidth=4
     42 set softtabstop=4
     43 
     44 " Enable persistent undo
     45 if has('persistent_undo')
     46     let undodir = expand('~/.vim/undo')
     47     if !isdirectory(undodir)
     48         call mkdir(undodir)
     49     endif
     50     let &undodir=undodir
     51     set undofile
     52 endif
     53 
     54 " Indent with 2 spaces in cpp files
     55 au FileType cpp setlocal shiftwidth=2 softtabstop=2 expandtab
     56 
     57 " Indent with 2 spaces in C files
     58 au FileType c setlocal shiftwidth=2 softtabstop=2 expandtab
     59 
     60 " Indent with 2 spaces in Arduino files
     61 au FileType arduino setlocal shiftwidth=2 softtabstop=2 expandtab