Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Add c-o to vimrc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hodgson committed Apr 16, 2018
1 parent f1e211a commit 53270a0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ filetype plugin indent on
call pathogen#infect()
call pathogen#helptags()


"Leaders {{{1
let mapleader = ","
let maplocalleader = "\\"
Expand Down Expand Up @@ -294,6 +295,20 @@ function! NewLatex()
setlocal filetype=tex
endfunction

" Strip the newline from the end of a string
function! Chomp(str)
return substitute(a:str, '\n$', '', '')
endfunction

" Find a file and pass it to cmd
function! DmenuOpen(cmd)
let fname = Chomp(system("git ls-files | rofi -dmenu -i -l 20 -p " . a:cmd))
if empty(fname)
return
endif
execute a:cmd . " " . fname
endfunction

" Commands {{{1

"gets the wp salts
Expand All @@ -314,6 +329,8 @@ nnoremap <F7> :set spell!<cr>
noremap <ScrollWheelUp> <nop>
noremap <ScrollWheelDown> <nop>
nnoremap <c-o> :call DmenuOpen("e")<cr>
" Make Ctrl C and Ctrl V work on system buffer
" if in visual or insert mode respectively
vnoremap <C-c> "+y
Expand Down

0 comments on commit 53270a0

Please sign in to comment.