You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,12 +35,6 @@ To display a tip (and not a quote) in your vim-startify you can include the foll
35
35
36
36
You'll probably also want to deactivate the basic tip display at startup.
37
37
38
-
## Add your own tips
39
-
40
-
If you want, you can add your own tips by modifying the files in the tips folder.
41
-
You may find them on your own system (probably in your plugin manager's files), but to simplify that I suggest forking my repo and adding your own changes in a version controlled repo.
let s:tiplist = ["C-k (+characters) : insert digraphs (æ,π...) in insert mode","C-K * p : insert π (in insert mode)","C-K Eu : insert € (in insert mode)","C-K +- : insert ± (in insert mode)","C-K OK : insert ✓ (in insert mode)","C-K XX : insert ✗ (in insert mode)","C-K AN : insert ∧ ('and' symbol) (in insert mode)","C-K OR : insert ∨ ('or' symbol) (in insert mode)","C-K (- : insert ∈ (in insert mode)","C-a : insert the last content inserted (in insert mode)","C-@ : insert the last content insert and quit insert mode (in insert mode)","C-h : delete character before the cursor (in insert mode)","C-l : delete character after the cursor (like Del) (in insert mode)","C-w : delete word under cursor (in insert mode)","C-o : execute one normal or command-mode and return to insert (in insert mode)","o : move cursor to opposite side of selection (in visual mode)","U : Uppercase the selection","C-v : Change to visual-bloc mode (from visual mode)","S-v : Change to visual mode (from visual-bloc mode)",]
85
+
lets:index=Rand() %len(s:tiplist)
86
+
returns:tiplist[s:index]
87
+
endfunction
80
88
81
89
82
90
@@ -88,7 +96,7 @@ endfunction
88
96
89
97
90
98
functionGetMiscallenous()
91
-
lets:tiplist=[":w! sudo tee % :write as root (ask password)","CTRL + w + = :resize splits equally","[[ : jump to function start",":new file.txt : open file.txt in new split","gt : show next tab","=% : indent code between parenthesis","C-w : (in insert mode) erases word from start to position","C-u : (in insert mode) erases line from start to position","// : run your previous search","CTRL + w + x : exchange with next window",]
99
+
lets:tiplist=[":w! sudo tee % :write as root (ask password)","CTRL + w + = :resize splits equally","[[ : jump to function start",":new file.txt : open file.txt in new split","gt : show next tab","=% : indent code between parenthesis","C-w : (in insert mode) erases word from start to position","C-u : (in insert mode) erases line from start to position","// : run your previous search","CTRL + w + x : exchange with next window","set <option> ? : see the value of a config option", "C-k (+characters) : insert digraphs (æ,π...) in insert mode","C-K-*-p : insert π (in insert mode)",]
92
100
lets:index=Rand() %len(s:tiplist)
93
101
returns:tiplist[s:index]
94
102
endfunction
@@ -116,13 +124,65 @@ function GetSelection()
116
124
returns:tiplist[s:index]
117
125
endfunction
118
126
119
-
functionDisplayTip()
120
127
121
-
lets:prefix="Tip => "
122
-
echos:prefix.g:GetTip()
128
+
functionGetPathTmpFile()
129
+
ifhas('win32')
130
+
let tmpfilepath =resolve(expand('<sfile>:p:h')).'\tmp_config'
131
+
else
132
+
let tmpfilepath =resolve(expand('<sfile>:p:h')).'/tmp_config'
133
+
endif
134
+
return tmpfilepath
135
+
endfunction
136
+
137
+
functionGetConfig()
138
+
try
139
+
let tmpfilepath =GetPathTmpFile()
140
+
lets:configlist=readfile(tmpfilepath)
141
+
lets:config=s:configlist[0]
142
+
catch
143
+
return""
144
+
endtry
145
+
returns:config
146
+
endfunction
147
+
148
+
149
+
functionPrepareNextConfig()
150
+
let tmpfilepath =GetPathTmpFile()
151
+
ifhas('win32')
152
+
"nothing yet
153
+
else
154
+
" on UNIX-like OS
155
+
silent!sleep5&
156
+
"instead, start here a bash/python script in background (&) that remove the first line
157
+
"of the tmpfile and if it is empty, populate it with the config fetched
0 commit comments