|
172 | 172 | "buffers":
|
173 | 173 | [
|
174 | 174 | {
|
175 |
| - "contents": "---\nlayout: post\ntitle: Vim Accumulated Tips\nexcerpt: \"A great list of some of the vim commands that could be really helpful to light-to-heavy Vim users everyday. Navigation and basic commands will not be listed here under the assumptions that they are elementary to survive in a entry-to-high level learning curve.\"\ndate: 2018-04-22\nmodifited: 2018-04-22\ncomments: true\npinned: true\ntags: [Linux]\n---\n##### Some command mode tips to better focus fingers on the keyboard.\nWhen there is a physical keyboard around, I prefer to use ```ESC``` to get out of insert mode. However, the new Macbook Pro adopts a touchbar with ```ESC``` in it and it is not fun to use under any circumstance. Luckily, it turns out that savior to this tragedy is another combination with one extra keystroke. Believe me, it is definitely worth it for the adaptation curve. \n~~~ shell\ncontrol + [ # faster way to exit insert mode\n# not prefered but still works\ncontrol + c # force quit all commands including buffered\n~~~\n##### Search and replace text in selection\nFor example there is a line\n~~~~ shell\nmusic amuse fuse refuse\n~~~~\nTo replace ```us``` with ```az```, the command would be \n~~~ SHELL\n:s/\\%Vus/az/g\n~~~\nThe ```\\%V``` specifies to search and replace in visual mode not entire file.\n#### Jump to a certain line\nMost often I use *number*+G to jump to a certain line in Vim. However, it is possible to jump to a line from file opening, which is most useful when debugging and file and found a breakpoint. There are multiple ways to do it but the simpliest are:\n~~~ shell\n# goto line 21\nvim file.xx +21\n# orhfdskfgfasffddfsafdfd\nvim file.xx -c \":21\"\n~~~", |
176 | 175 | "file": "_posts/2018-4-22-vim-tips.md",
|
177 |
| - "file_size": 1615, |
178 |
| - "file_write_time": 131737344922369528, |
179 | 176 | "settings":
|
180 | 177 | {
|
181 |
| - "buffer_size": 1636, |
| 178 | + "buffer_size": 2468, |
182 | 179 | "line_ending": "Unix"
|
183 | 180 | }
|
| 181 | + }, |
| 182 | + { |
| 183 | + "file": "_posts/2018-01-11-mac-application.md", |
| 184 | + "settings": |
| 185 | + { |
| 186 | + "buffer_size": 3482, |
| 187 | + "encoding": "UTF-8", |
| 188 | + "line_ending": "Unix" |
| 189 | + } |
| 190 | + }, |
| 191 | + { |
| 192 | + "file": "_drafts/2018-06-20-machine-learning.md", |
| 193 | + "settings": |
| 194 | + { |
| 195 | + "buffer_size": 1098, |
| 196 | + "encoding": "UTF-8", |
| 197 | + "line_ending": "Unix", |
| 198 | + "name": "## Hoare logic[^1]" |
| 199 | + } |
184 | 200 | }
|
185 | 201 | ],
|
186 | 202 | "build_system": "",
|
|
258 | 274 | "last_filter": "",
|
259 | 275 | "selected_items":
|
260 | 276 | [
|
| 277 | + [ |
| 278 | + "list", |
| 279 | + "Package Control: List Packages" |
| 280 | + ], |
261 | 281 | [
|
262 | 282 | "instal",
|
263 | 283 | "Package Control: Install Package"
|
|
266 | 286 | "package",
|
267 | 287 | "Package Control: Disable Package"
|
268 | 288 | ],
|
269 |
| - [ |
270 |
| - "list", |
271 |
| - "Package Control: List Packages" |
272 |
| - ], |
273 | 289 | [
|
274 | 290 | "lis",
|
275 | 291 | "Permute Lines: Shuffle"
|
|
319 | 335 | },
|
320 | 336 | "console":
|
321 | 337 | {
|
322 |
| - "height": 0.0, |
| 338 | + "height": 137.0, |
323 | 339 | "history":
|
324 | 340 | [
|
325 | 341 | ]
|
|
335 | 351 | },
|
336 | 352 | "expanded_folders":
|
337 | 353 | [
|
338 |
| - "/Users/yixia/geeknerd.github.io", |
339 |
| - "/Users/yixia/geeknerd.github.io/_posts" |
| 354 | + "/Users/yixia/geeknerd.github.io" |
340 | 355 | ],
|
341 | 356 | "file_history":
|
342 | 357 | [
|
343 |
| - "/Users/yixia/geeknerd.github.io/_posts/2018-4-22-vim-tips.md", |
| 358 | + "/Users/yixia/geeknerd.github.io/_posts/2018-06-18-alfred-permission.md", |
344 | 359 | "/Users/yixia/geeknerd.github.io/_posts/2018-01-09-sublime-text.md",
|
| 360 | + "/Users/yixia/geeknerd.github.io/_posts/2018-4-22-vim-tips.md", |
345 | 361 | "/Users/yixia/Downloads/ddd/团子系列/团子系列/毛衣少女/sanjiery_tumblr_com02.jpg",
|
346 | 362 | "/Users/yixia/Documents/python_work/ch7.py",
|
347 | 363 | "/Users/yixia/Documents/python_work/ch5.py",
|
|
466 | 482 | "/Users/yixia/Documents/Downloads/Criminal.Minds.S03.DVDRip.XviD-MiXED/criminal.minds.s03e14.dvdrip.xvid.repack-orpheus.chs_en.srt",
|
467 | 483 | "/Users/yixia/Documents/2018_Spring/155E/CSCE155-C-Lab05/physicsCalc.c",
|
468 | 484 | "/Users/yixia/Documents/2018_Spring/155E/CSCE155-C-Lab05/sine.c",
|
469 |
| - "/Users/yixia/Documents/2018_Spring/155E/CSCE155-C-Lab06/florist.c", |
470 |
| - "/Users/yixia/Documents/2018_Spring/155E/CSCE155-C-Lab12/drive.c" |
| 485 | + "/Users/yixia/Documents/2018_Spring/155E/CSCE155-C-Lab06/florist.c" |
471 | 486 | ],
|
472 | 487 | "find":
|
473 | 488 | {
|
|
502 | 517 | "groups":
|
503 | 518 | [
|
504 | 519 | {
|
505 |
| - "selected": 0, |
| 520 | + "selected": 2, |
506 | 521 | "sheets":
|
507 | 522 | [
|
508 | 523 | {
|
|
511 | 526 | "semi_transient": false,
|
512 | 527 | "settings":
|
513 | 528 | {
|
514 |
| - "buffer_size": 1636, |
| 529 | + "buffer_size": 2468, |
515 | 530 | "regions":
|
516 | 531 | {
|
517 | 532 | },
|
518 | 533 | "selection":
|
519 | 534 | [
|
520 | 535 | [
|
521 |
| - 1065, |
522 |
| - 1065 |
| 536 | + 1100, |
| 537 | + 1100 |
523 | 538 | ]
|
524 | 539 | ],
|
525 | 540 | "settings":
|
|
532 | 547 | "translation.y": 0.0,
|
533 | 548 | "zoom_level": 1.0
|
534 | 549 | },
|
| 550 | + "stack_index": 2, |
| 551 | + "type": "text" |
| 552 | + }, |
| 553 | + { |
| 554 | + "buffer": 1, |
| 555 | + "file": "_posts/2018-01-11-mac-application.md", |
| 556 | + "semi_transient": false, |
| 557 | + "settings": |
| 558 | + { |
| 559 | + "buffer_size": 3482, |
| 560 | + "regions": |
| 561 | + { |
| 562 | + }, |
| 563 | + "selection": |
| 564 | + [ |
| 565 | + [ |
| 566 | + 2308, |
| 567 | + 2308 |
| 568 | + ] |
| 569 | + ], |
| 570 | + "settings": |
| 571 | + { |
| 572 | + "is_init_dirty_state": false, |
| 573 | + "origin_encoding": "ASCII", |
| 574 | + "syntax": "Packages/MarkdownEditing/Markdown.sublime-syntax" |
| 575 | + }, |
| 576 | + "translation.x": 0.0, |
| 577 | + "translation.y": 343.0, |
| 578 | + "zoom_level": 1.0 |
| 579 | + }, |
| 580 | + "stack_index": 1, |
| 581 | + "type": "text" |
| 582 | + }, |
| 583 | + { |
| 584 | + "buffer": 2, |
| 585 | + "file": "_drafts/2018-06-20-machine-learning.md", |
| 586 | + "semi_transient": false, |
| 587 | + "settings": |
| 588 | + { |
| 589 | + "buffer_size": 1098, |
| 590 | + "regions": |
| 591 | + { |
| 592 | + }, |
| 593 | + "selection": |
| 594 | + [ |
| 595 | + [ |
| 596 | + 184, |
| 597 | + 184 |
| 598 | + ] |
| 599 | + ], |
| 600 | + "settings": |
| 601 | + { |
| 602 | + "is_init_dirty_state": false, |
| 603 | + "origin_encoding": "UTF-8", |
| 604 | + "syntax": "Packages/MarkdownEditing/Markdown.sublime-syntax" |
| 605 | + }, |
| 606 | + "translation.x": 0.0, |
| 607 | + "translation.y": 0.0, |
| 608 | + "zoom_level": 1.0 |
| 609 | + }, |
535 | 610 | "stack_index": 0,
|
536 | 611 | "type": "text"
|
537 | 612 | }
|
|
627 | 702 | "show_open_files": true,
|
628 | 703 | "show_tabs": true,
|
629 | 704 | "side_bar_visible": true,
|
630 |
| - "side_bar_width": 253.0, |
| 705 | + "side_bar_width": 262.0, |
631 | 706 | "status_bar_visible": true,
|
632 | 707 | "template_settings":
|
633 | 708 | {
|
|
0 commit comments