Skip to content

Instantly share code, notes, and snippets.

@nedludd
Last active August 2, 2018 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nedludd/846c2feeff246ee8970a668baf03423b to your computer and use it in GitHub Desktop.
Save nedludd/846c2feeff246ee8970a668baf03423b to your computer and use it in GitHub Desktop.
cVim Config
"" Settings -----------------------------------------------------
" set nohud
" set nosmoothscroll
" set noautofocus " The opposite of autofocus; this setting stops
" " sites from focusing on an input box when they load
" set typelinkhints
let searchlimit = 10
" let scrollstep = 70
let barposition = "bottom"
" let locale = "uk" " Current choices are 'jp' and 'uk'. This allows cVim to use sites like google.co.uk
" " or google.co.jp to search rather than google.com. Support is currently limited.
let hintcharacters = "asdfhjkl"
"" Search -------------------------------------------------------
" let searchengine dogpile = "http://www.dogpile.com/search/web?q=%s" " If you leave out the '%s' at the end of the URL,
" " your query will be appended to the link.
" " Otherwise, your query will replace the '%s'.
" " This will do the same thing as above, except typing ':tabnew withbase' into to command bar
" " without any search parameters will open 'http://www.dogpile.com'
" let searchengine withbase = ["http://www.dogpile.com", "http://www.dogpile.com/search/web?q=%s"]
" " alias ':g' to ':tabnew google'
" command g tabnew google
" let completionengines = ["google", "amazon", "imdb", "dogpile"]
" let searchalias g = "google" " Create a shortcut for search engines.
" " For example, typing ':tabnew g example'
" " would act the same way as ':tabnew google example'
"" Quickmarks --------------------------------------------------
" " Open all of these in a tab with `gnb` or open one of these with <N>goa where <N>
let qmark c = ["https://my.cozi.com/calendar/"]
let qmark n = ["https://news.ycommunicator.com/"]
let qmark r = ["http://www.reddit.com"]
let blacklists = ["https://mail.google.com/*","*://mail.google.com/*","@https://mail.google.com/mail/*"]
" " blacklists prefixed by '@' act as a whitelist
"" Key Mappings ---------------------------------------------------
map $ lastTab
map ^ firstTab
unmap u d
map u :viewsource!<CR>
map d closeTab
let mapleader = ","
" Mappings
map <Leader>r reloadTabUncached
map <Leader>u :restore<Space>
" This remaps the default 'j' mapping
map j scrollUp
" You can use <Space>, which is interpreted as a
" literal " " character, to enter buffer completion mode
map gb :buffer<Space>
" This unmaps the default 'k' mapping
unmap k
" This unmaps the default 'h', 'j', 'k', and 'l' mappings
unmap h j k l
" This remaps the default 'f' mapping to the current 'F' mapping
map f F
" Toggle the current HUD display value
" map <C-h> :set hud!<CR>
" Switch between alphabetical hint characters and numeric hints
map <C-u> rootFrame
map J previousTab
map K nextTab
unmap <C-f>
map <C-f> scrollPageDown
unmap <C-b>
map <C-b> scrollPageUp
iunmap <C-y>
imap <C-m> deleteWord
" Create a variable that can be used/referenced in the command bar
let @@reddit_prog = 'http://www.reddit.com/r/programming'
let @@top_all = 'top?sort=top&t=all'
let @@top_day = 'top?sort=top&t=day'
" TA binding opens 'http://www.reddit.com/r/programming/top?sort=top&t=all' in a new tab
map TA :tabnew @@reddit_prog/@@top_all<CR>
map TD :tabnew @@reddit_prog/@@top_day<CR>
" Use paste buffer in mappings
" map T :tabnew wikipedia @"<CR>
" Code blocks (see below for more info)
getIP() -> {{
httpRequest({url: 'http://api.ipify.org/?format=json', json: true},
function(res) { Status.setMessage('IP: ' + res.ip); });
}}
" Displays your public IP address in the status bar
map ci :call getIP<CR>
" Script hints
echo(link) -> {{
alert(link.href);
}}
" map <C-x> createScriptHint(echo)
"let configpath = '/Users/therma000/.cvimrc'
"set localconfig " Update settings via a local file (and the `:source` command) rather
" than the default options page in chrome
" As long as localconfig is set in the .cvimrc file. cVim will continue to read
" settings from there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment