" Cache a possibly filled location list for a hiding buffer. | |
" Check if there is a non-empty list for the current buffer. | |
" Stores the list to the cache and empty the original one. | |
" The location window will be closed. | |
" | |
" Arguments: | |
" buffer - buffer to create the cache for | |
" | |
function! utils#location#cache_location_list(buffer) abort | |
if get(g:, 'dynamic_location_list_disable', v:false) | return | endif |
" Way out of date now ... | |
" findfile.vim -- interactive file search | |
" Experimental; caveat emptor. | |
" Documentation is at the end. | |
" Public Domain. | |
let s:cpo = &cpo | |
set cpo&vim |
I recently tried out the fantastic vim-tmux-navigator
tmux plugin.
Unfortunately, some the default key bindings conflict with some of the key bindings my fuzzy finder of choice uses.
I wanted to remap them to the default vim split navigation commands that are prefixed with C-w
, and found the solution of
hjdivad in his gist. However, I wanted a simpler solution, so after
some more digging I stumbled upon this reddit post
and ultimately came up with the following solution, which doesn't rely on key bindings that unbind themselves, but uses tmux's
'key-tables'.
jq will sort (-S
) the whole file (.
) and compare STDOUT (<()
) with diff
diff <(jq -S . A.json) <(jq -S . B.json)
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
Vim has many plugins (vim-go, ale, etc.) that use the quickfix/location list | |
feature. Some of these plugins process the output of an external command and | |
update the quickfix list asynchronously as the output becomes available. | |
Updating a quickfix or location list asynchronously opens up the possibility | |
that two or more plugins may try to update the same quickfix list with | |
different output. Also when a plugin is updating a quickfix list in the | |
background, the user may issue a command that creates or updates a quickfix | |
list. The plugin may then incorrectly use this new list to add the entries. |
You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.
autocmd FileType <filetype> setlocal makeprg=<external command>
This autocommand tells Vim to use <external command>
when invoking :make %
in a <filetype>
buffer. You can add as many similar lines as needed for other languages.
This is an intuitive command-line mode mapping to insert the current line.
It is no longer needed since 8.0.1787 because the feature is now built-in. See :help c_ctrl-r_ctrl-l
.