{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"ecmaFeatures": { |
Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
Your problem with Vim is that you don't grok vi.
You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).
The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:
0 go to the beginning of this line. y yank from here (up to where?)
console.log(1); | |
(_ => console.log(2))(); | |
eval('console.log(3);'); | |
console.log.call(null, 4); | |
console.log.apply(null, [5]); | |
new Function('console.log(6)')(); | |
Reflect.apply(console.log, null, [7]) | |
Reflect.construct(function(){console.log(8)}, []); | |
Function.prototype.apply.call(console.log, null, [9]); | |
Function.prototype.call.call(console.log, null, 10); |
Keyboard Control | |
LEFT and RIGHT | |
Seek backward/forward 5 seconds. Shift+arrow does a 1 second exact seek (see --hr-seek). | |
UP and DOWN | |
Seek forward/backward 1 minute. Shift+arrow does a 5 second exact seek (see --hr-seek). | |
Ctrl+LEFT and Ctrl+RIGHT | |
Seek to the previous/next subtitle. Subject to some restrictions and might not always work; see sub-seek command. | |
Ctrl+Shift+Left and Ctrl+Shift+Right | |
Adjust subtitle delay so that the next or previous subtitle is displayed now. This is especially useful to sync subtitles to audio. | |
[ and ] |
" Vim syntax file | |
" Language: Todo | |
" Maintainer: Huy Tran | |
" Latest Revision: 14 June 2020 | |
if exists("b:current_syntax") | |
finish | |
endif | |
" Custom conceal |
I've been maintaining my own version of Strip Trailing Spaces function (attached at the bottom of this post) since I first started using vim. It grew out of a simple :%s/\s*$//
and now includes a number of features:
- it preserves search history and the last search string
- it doesn't change editor's
''
,'.
and'^
marks - it doesn't add a new jumplist and changelist record
- it preserves editor's view and cursor position
However, over the years I've noticed that I never needed to undo the results of stripping trailing spaces from a file. In fact, I would go as far as to say that when undoing changes in a file, the function produces an understandable but somewhat undesirable cursor jump (to the top-most trailing space it strippes) which disrupts my work flow. So, I set about to exclude the results of this function from the undo history all together.
After reading [Restore the cursor position after undoing text change made by a script](http://vim.wikia.com/wiki/Restore_the_cursor_position_aft
" Console log from insert mode; Puts focus inside parentheses | |
imap cll console.log();<Esc>==f(a | |
" Console log from visual mode on next line, puts visual selection inside parentheses | |
vmap cll yocll<Esc>p | |
" Console log from normal mode, inserted on next line with word your on inside parentheses | |
nmap cll yiwocll<Esc>p |
Install svg-inline-loader for webpack :
npm install svg-inline-loader --save-dev
Add it to your loaders in module.loaders
section of webpack.config.js
:
{
test: /\.svg$/,
loader: 'svg-inline-loader'
// ==UserScript== | |
// @name Discord - Open chat in popup | |
// @namespace lleaff | |
// @updateURL https://gist.github.com/lleaff/8514033dc8e54ce02d6adf3c2e46d8ff/raw/Discord_-_Open_chat_in_popup.user.js | |
// @supportURL https://gist.github.com/lleaff/8514033dc8e54ce02d6adf3c2e46d8ff#comments | |
// @match https://discordapp.com/channels/* | |
// @version 1 | |
// @run-at document-end | |
// @grant none | |
// @noframes |