• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision17ea707f3bd57c677a3c7a566296a2a831c4061e (tree)
l'heure2018-02-24 08:03:56
AuteurMarkus Prepens <markus.prepens@gmai...>
CommiterMarkus Prepens

Message de Log

Merge branch 'master' of https://github.com/analogbit/nvim

Change Summary

Modification

--- a/autoload/shellcommand.vim
+++ b/autoload/shellcommand.vim
@@ -9,7 +9,7 @@
99 function! shellcommand#Run(cmdLine)
1010
1111 if !exists("s:outputBuffer")
12- let s:outputBuffer = tempname()
12+ let s:outputBuffer = "[SCRun]"
1313 endif
1414
1515 let winnr = bufwinnr(s:outputBuffer)
@@ -27,7 +27,7 @@ function! shellcommand#Run(cmdLine)
2727 else
2828 " No ShellCommand buffer
2929 execute "edit " . s:outputBuffer
30- setlocal noswapfile nowrap
30+ setlocal noswapfile nowrap buftype=nofile
3131 endif
3232
3333 let cmdRun = ""
--- a/autoload/whitespace.vim
+++ b/autoload/whitespace.vim
@@ -23,15 +23,15 @@ endfunction
2323 " Description: Delete empty lines around cursor.
2424 function! s:OneBlankLine()
2525 while line('.') > 1 && empty(getline(line('.') - 1))
26- normal kdd
26+ normal k"_dd
2727 endwhile
2828 while line('.') < line('$') && empty(getline(line('.'))) && empty(getline(line('.') + 1))
29- normal dd
29+ normal "_dd
3030 endwhile
3131 " Top and last lines needs special treatment.
3232 if line('.') == 1 || line('.') == line('$')
3333 if empty(getline('.'))
34- normal dd
34+ normal "_dd
3535 endif
3636 endif
3737 endfunction
@@ -40,10 +40,10 @@ endfunction
4040 function! s:OneSpace()
4141 if s:CharUnderCursor("curr") == " "
4242 while s:CharUnderCursor("prev") == " " && getcurpos()[2] > 1
43- normal hx
43+ normal h"_x
4444 endwhile
4545 while s:CharUnderCursor("next") == " "
46- normal x
46+ normal "_x
4747 endwhile
4848 endif
4949 endfunction
--- a/init.vim
+++ b/init.vim
@@ -98,7 +98,7 @@ set completeopt=menu
9898 set pumheight=10
9999
100100 " Command line completion
101-set nowildmenu wildmode=list:full
101+set nowildmenu wildmode=list:longest
102102 set wildignorecase
103103 set wildignore=*.*~
104104
@@ -125,19 +125,15 @@ set diffopt=context:3,vertical,iwhite,filler
125125 " Note: 'cursorline' may delay cursor movement in buffer with filetype 'c'.
126126 " This behavior may be caused by Doxygen syntax highlighting.
127127 function! s:TurnCursorLineOn()
128-
129128 if g:use_sticky_cursorline !=0 && &diff == 0 && &buftype == ""
130129 set cursorline
131130 endif
132-
133131 endfunction
134132
135133 function! ToggleStickyCursorLine()
136-
137134 if !exists("g:use_sticky_cursorline")
138135 let g:use_sticky_cursorline = 0
139136 endif
140-
141137 if g:use_sticky_cursorline == 0
142138 let g:use_sticky_cursorline = 1
143139 set cursorline
@@ -153,25 +149,20 @@ function! ToggleStickyCursorLine()
153149 au!
154150 augroup END
155151 endif
156-
157152 endfunction
158153
159154 " Description: Jump to last location. Check out :help line(). Function checks
160155 " if the '" marker is valid. Jump to the mark, but don't change the jumplist
161156 " when jumping within the current buffer (:help g').
162157 function! RestoreCursor ()
163-
164158 if line("'\"") > 1 && line("'\"") <= line("$")
165159 exe "normal! g'\""
166160 endif
167-
168161 endfunction
169162
170163 " Description: A context sensitve file movement function.
171164 function! FastForwardAndRewind(direction)
172-
173165 if a:direction == "fastforward"
174-
175166 if &diff
176167 normal ]czz
177168 elseif &filetype == "diff"
@@ -183,9 +174,7 @@ function! FastForwardAndRewind(direction)
183174 else
184175 normal ]]
185176 endif
186-
187177 elseif a:direction == "rewind"
188-
189178 if &diff
190179 normal [czz
191180 elseif &filetype == "diff"
@@ -197,32 +186,38 @@ function! FastForwardAndRewind(direction)
197186 else
198187 normal [[
199188 endif
200-
201189 endif
202-
203190 endfunction
204191
205192 function! HiName()
206-
207193 let synid = synID(line("."), col("."), 0)
208194 let synidtrans = synIDtrans(synid)
209195 echo synIDattr(synidtrans, "name")
210-
211196 endfunction
212197
198+" Description: My splash screen (with one-liner Vim script in it)
213199 function! Welcome()
214-
215200 let l:welcome_text_file = '~/Documents/welcome.txt'
216-
217201 if filereadable(expand(l:welcome_text_file))
218202 execute 'edit ' . l:welcome_text_file
219203 nmap <buffer> <CR> 0y$:<C-r>"<CR>
220204 endif
205+endfunction
221206
207+" Description: Create or move to buffer ClipboardTxt, start to write text,
208+" switch to another application and copy the clipboard, filled with
209+" ClipboardTxt.
210+function! ClipboardBuffer()
211+ if bufexists("ClipboardTxt")
212+ buffer ClipboardTxt
213+ else
214+ edit ClipboardTxt
215+ setlocal buftype=nofile
216+ autocmd FocusLost clipboard.txt normal gg"*yG
217+ endif
222218 endfunction
223219
224220 function! HighlightWord(word)
225-
226221 if !exists("s:thisHighlightWord")
227222 let s:thisHighlightWord = ""
228223 endif
@@ -234,7 +229,6 @@ function! HighlightWord(word)
234229 let s:thisHighlightWord = ""
235230 match none
236231 endif
237-
238232 endfunction
239233
240234 " }}}
@@ -254,7 +248,6 @@ command! -nargs=0 SwitchWorkspace call workspace#Switch()
254248 command! -nargs=0 ShowHiName call HiName()
255249 command! -nargs=0 ToggleStickyCursorline call ToggleStickyCursorLine()
256250
257-
258251 command! -nargs=0 WhitespaceCleanup call whitespace#Cleanup()
259252 command! -nargs=0 WhitespaceMelt call whitespace#Melt()
260253
@@ -327,6 +320,7 @@ nnoremap <Leader>h :call HighlightWord("<C-r><C-w>")<CR>
327320 nnoremap <Leader>tn :$tabnew<CR>
328321 nnoremap <Leader>tc :tabclose<CR>
329322
323+nnoremap <Leader>c :call ClipboardBuffer()<CR>
330324 nnoremap <Leader>dt :ToggleVimdiff<CR>
331325 nnoremap <Leader>du :wa <BAR> diffupdate<CR>
332326 nnoremap <Leader>do :VimdiffFileContext<CR>
@@ -398,8 +392,7 @@ cnoremap <A-.> <C-r>=expand("%:p:h")<CR>
398392
399393 " }}}
400394
401-
402-" Save when losing focus
395+" Save when Neovim's losing or gaining focus
403396 augroup ginit
404397 " clear group in case file sourced several times
405398 autocmd!