~koehr/configs

configs/dot.config/cvimrc -rw-r--r-- 3.4 KiB
d108c455 — koehr update README 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
" Settings
set nohud
set smoothscroll
set noautofocus " The opposite of autofocus; this setting stops
                " sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
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 me know if you need a different locale for one of the completion/search engines
let hintcharacters = "asdfgqwertzxcvb12345"

let searchengine dogpile = "https://duckduckgo.com/?q=" " 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 = ["https://duckduckgo.com", "https://duckduckgo.com/?q=%s"]

let completionengines = ["duckduckgo", "amazon", "imdb", "dogpile"]

let searchalias ddg = "duckduckgo" " Create a shortcut for search engines.
                                   " For example, typing ':tabnew g example'
                                   " would act the same way as ':tabnew google example'

" Open all of these in a tab with `gnb` or open one of these with <N>goa where <N>
" let qmark a = ["http://www.reddit.com", "http://www.google.com", "http://twitter.com"]

" let blacklists = ["https://mail.google.com/*", "*://mail.google.com/*", "@https://mail.google.com/mail/*"]
" blacklists prefixed by '@' act as a whitelist

let mapleader = ","

" Mappings

map <Leader>r reloadTabUncached
" map <Leader>x :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 b :buffer<Space>
map B :bookmarks<Space>

" 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-i> :set numerichints!<CR>

" 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-f> createScriptHint(echo)

let configpath = '~/.config/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