Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quick link. #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ch00_read_this_first.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ This guide wouldn't be possible without Bram Moleenar for creating Vim, my wife

Thank you. You all help make text editing fun :)


## Link
- Next [Ch01. Starting Vim](./ch01_starting_vim.md)
4 changes: 4 additions & 0 deletions ch01_starting_vim.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,7 @@ If you need to suspend Vim while in the middle of editing, you can press `Ctrl-z
The `vim` command can take many different options, just like any other terminal command. Two options allow you to pass a Vim command as a parameter: `+{cmd}` and `-c cmd`. As you learn more commands throughout this guide, see if you can apply it when starting Vim. Also being a terminal command, you can combine `vim` with many other terminal commands. For example, you can redirect the output of the `ls` command to be edited in Vim with `ls -l | vim -`.

To learn more about `vim` command in the terminal, check out `man vim`. To learn more about the Vim editor, continue reading this guide along with the `:help` command.

## Link
- Prev [Ch00. Read This First](./ch00_read_this_first.md)
- Next [Ch02. Buffers, Windows, and Tabs](./ch02_buffers_windows_tabs.md)
4 changes: 4 additions & 0 deletions ch02_buffers_windows_tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,7 @@ Everyone has a different workflow, here is mine for example:
- Instead of tabs, I use [tmux](https://github.com/tmux/tmux/wiki) windows. I usually use multiple tmux windows at once. For example, one tmux window for client-side codes and another for backend codes.

My workflow may look different from yours based on your editing style and that's fine. Experiment around to discover your own flow, suiting your coding style.

## Link
- Prev [Ch01. Starting Vim](./ch01_starting_vim.md)
- Next [Ch03. Searching Files](./ch03_searching_files.md)
4 changes: 4 additions & 0 deletions ch03_searching_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,7 @@ Searching is the bread-and-butter of text editing. Learning how to search well i
Fzf.vim is a game-changer. I can't imagine using Vim without it. I think it is very important to have a good search tool when starting Vim. I've seen people struggling to transition to Vim because it seems to be missing critical features modern text editors have, like an easy and powerful search feature. I hope this chapter will help you to make the transition to Vim easier.

You also just saw Vim's extensibility in action - the ability to extend search functionality with a plugin and an external program. In the future, keep in mind of what other features you wish to extend Vim with. Chances are, it's already in Vim, someone has created a plugin or there is a program for it already. Next, you'll learn about a very important topic in Vim: Vim grammar.

## Link
- Prev [Ch02. Buffers, Windows, and Tabs](./ch02_buffers_windows_tabs.md)
- Next [Ch04. Vim Grammar](./ch04_vim_grammar.md)
4 changes: 4 additions & 0 deletions ch04_vim_grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,7 @@ You just learned about Vim grammar's rule: `verb + noun`. One of my biggest Vim
The goal of this chapter is to show you the `verb + noun` pattern in Vim so you will approach learning Vim like learning a new language instead of memorizing every command combination.

Learn the pattern and understand the implications. That's the smart way to learn.

## Link
- Prev [Ch03. Searching Files](./ch03_searching_files.md)
- Next [Ch05. Moving in a File](./ch05_moving_in_file.md)
4 changes: 4 additions & 0 deletions ch05_moving_in_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,7 @@ To improve your navigation skill, here are my suggestions:
Finally, realize that you do not need to know every single Vim command to be productive. Most Vim users don't. I don't. Learn the commands that will help you accomplish your task at that moment.

Take your time. Navigation skill is a very important skill in Vim. Learn one small thing every day and learn it well.

## Link
- Prev [Ch04. Vim Grammar](./ch04_vim_grammar.md)
- Next [Ch06. Insert Mode](./ch06_insert_mode.md)
4 changes: 4 additions & 0 deletions ch06_insert_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,7 @@ Ctrl-O D Delete from current location to the end of the line
If you are like me and you come from another text editor, it can be tempting to stay in insert mode. However, staying in insert mode when you're not entering a text is an anti-pattern. Develop a habit to go to normal mode when your fingers aren't typing new text.

When you need to insert a text, first ask yourself if that text already exists. If it does, try to yank or move that text instead of typing it. If you have to use insert mode, see if you can autocomplete that text whenever possible. Avoid typing the same word more than once if you can.

## Link
- Prev [Ch05. Moving in a File](./ch05_moving_in_file.md)
- Next [Ch07. the Dot Command](./ch07_the_dot_command.md)
4 changes: 4 additions & 0 deletions ch07_the_dot_command.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,7 @@ The dot command's power comes from exchanging several keystrokes for one. It is
When editing, think about repeatability. For example, if I need to remove the next three words, is it more economical to use `d3w` or to do `dw` then `.` two times? Will you be deleting a word again? If so, then it makes sense to use `dw` and repeat it several times instead of `d3w` because `dw` is more reusable than `d3w`.

The dot command is a versatile command for automating single changes. In a later chapter, you will learn how to automate more complex actions with Vim macros. But first, let's learn about registers to store and retrieve text.

## Link
- Prev [Ch06. Insert Mode](./ch06_insert_mode.md)
- Next [Ch08. Registers](./ch08_registers.md)
4 changes: 4 additions & 0 deletions ch08_registers.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,7 @@ Since the unnamed register defaults to `p` and `P`, you only have to learn two r
The average human has a limited short-term memory capacity, about 5 - 7 items at once. That is why in my everyday editing, I only use about 5 - 7 named registers. There is no way I can remember all twenty-six in my head. I normally start with register a, then b, ascending the alphabetical order. Try it and experiment around to see what technique works best for you.

Vim registers are powerful. Used strategically, it can save you from typing countless repeating texts. Next, let's learn about macros.

## Link
- Prev [Ch07. the Dot Command](./ch07_the_dot_command.md)
- Next [Ch09. Macros](./ch09_macros.md)
4 changes: 4 additions & 0 deletions ch09_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,7 @@ In the beginning, I find it very awkward to write macros, but don't give up. Wit
You might find it helpful to use mnemonics to help remember your macros. If you have a macro that creates a function, use the "f register (`qf`). If you have a macro for numerical operations, the "n register should work (`qn`). Name it with the *first named register* that comes to your mind when you think of that operation. I also find that the "q register makes a good default macro register because `qq` requires less brain power to come up with. Lastly, I also like to increment my macros in alphabetical orders, like `qa`, then `qb`, then `qc`, and so on.

Find a method that works best for you.

## Link
- Prev [Ch08. Registers](./ch08_registers.md)
- Next [Ch10. Undo](./ch10_undo.md)
4 changes: 4 additions & 0 deletions ch10_undo.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,7 @@ The same set of arguments work with `:earlier` counterpart: `:later`.

Prior to this chapter, you learned how to find any text in a project space, with undo, you can now find any text in a time dimension. You are now able to search for any text by its location and time written. You have achieved Vim-omnipresence.


## Link
- Prev [Ch09. Macros](./ch09_macros.md)
- Next [Ch11. Visual Mode](./ch11_visual_mode.md)
4 changes: 4 additions & 0 deletions ch11_visual_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,7 @@ I personally never used select mode, but it's good to know that it exists.
The visual mode is Vim's representation of the text highlighting procedure.

If you find yourself using visual mode operation far more often than normal mode operations, be careful. This is an anti-pattern. It takes more keystrokes to run a visual mode operation than its normal mode counterpart. For example, if you need to delete an inner word, why use four keystrokes, `viwd` (visually highlight an inner word then delete), if you can accomplish it with just three keystrokes (`diw`)? The latter is more direct and concise. Of course, there will be times when visual modes are appropriate, but in general, favor a more direct approach.

## Link
- Prev [Ch10. Undo](./ch10_undo.md)
- Next [Ch12. Search and Substitute](./ch12_search_and_substitute.md)
4 changes: 4 additions & 0 deletions ch12_search_and_substitute.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,3 +717,7 @@ The ability to do search well is a necessary skill in editing. Mastering the sea
A good way to improve your pattern matching skill is whenever you need to search for a pattern (like "hello 123"), instead of querying for the literal search term (`/hello 123`), try to come up with a pattern for it (something like `/\v(\l+) (\d+)`). Many of these regular expression concepts are also applicable in general programming, not only when using Vim.

Now that you learned about advanced search and substitution in Vim, let's learn one of the most versatile commands, the global command.

## Link
- Prev [Ch11. Visual Mode](./ch11_visual_mode.md)
- Next [Ch13. the Global Command](./ch13_the_global_command.md)
4 changes: 4 additions & 0 deletions ch13_the_global_command.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,3 +550,7 @@ Some of the examples here are complicated. Do not be intimidated. Really take yo
Whenever you need to run multiple commands, pause and see if you can use the `g` command. Identify the best command for the job and write a pattern to target as many things at once.

Now that you know how powerful the global command is, let's learn how to use the external commands to increase your tool arsenals.

## Link
- Prev [Ch12. Search and Substitute](./ch12_search_and_substitute.md)
- Next [Ch14. External Commands](./ch14_external_commands.md)
4 changes: 4 additions & 0 deletions ch14_external_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,7 @@ The filter normal command only works on motions / text objects that are at least
Vim is not an IDE. It is a lightweight modal editor that is highly extensible by design. Because of this extensibility, you have an easy access to any external command in your system. Armed with these external commands, Vim is one step closer from becoming an IDE. Someone said that the Unix system is the first IDE ever.

The bang command is as useful as how many external commands you know. Don't worry if your external command knowledge is limited. I still have a lot to learn too. Take this as a motivation for continuous learning. Whenever you need to modify a text, look if there is an external command that can solve your problem. Don't worry about mastering everything, just learn the ones you need to complete the current task.

## Link
- Prev [Ch13. the Global Command](./ch13_the_global_command.md)
- Next [Ch15. Command-line Mode](./ch15_command-line_mode.md)
4 changes: 4 additions & 0 deletions ch15_command-line_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,7 @@ Vim has hundreds of built-in commands. To see all the commands Vim have, check o
Compared to the other three modes, the command-line mode is like the Swiss Army knife of text editing. You can edit text, modify files, and execute commands, just to name a few. This chapter is a collection of odds and ends of the command-line mode. It also brings Vim modes into closure. Now that you know how to use the normal, insert, visual, and command-line mode you can edit text with Vim faster than ever.

It's time to move away from Vim modes and learn how to do an even faster navigation with Vim tags.

## Link
- Prev [Ch14. External Commands](./ch14_external_commands.md)
- Next [Ch16. Tags](./ch16_tags.md)
4 changes: 4 additions & 0 deletions ch16_tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,7 @@ functionFood -> functionBreakfast -> functionPancake
This gives you insight that this code flow is related to having a pancake for breakfast.

To learn more about tags, check out `:h tags`. Now that you know how to use tags, let's explore a different feature: folding.

## Link
- Prev [Ch15. Command-line Mode](./ch15_command-line_mode.md)
- Next [Ch17. Fold](./ch17_fold.md)
4 changes: 4 additions & 0 deletions ch17_fold.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,7 @@ By default, Vim saves the fold information when running `mkview` inside `~/.vim/
When I first started Vim, I neglected to learn fold because I didn't think it was useful. However, the longer I code, the more useful I find folding is. Strategically placed folds can give you a better overview of the text structure, like a book's table of content.

When you learn fold, start with the manual fold because that can be used on-the-go. Then gradually learn different tricks to do indent and marker folds. Finally, learn how to do syntax and expression folds. You can even use the latter two to write your own Vim plugins.

## Link
- Prev [Ch16. Tags](./ch16_tags.md)
- Next [Ch18. Git](./ch18_git.md)
4 changes: 4 additions & 0 deletions ch18_git.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,7 @@ If you are inside one of vim-fugitive's "special mode" (for example, inside `:Gi
You may find vim-fugitive to be a good compliment to your workflow (or not). Regardless, I would strongly encourage you to check out all the plugins listed above. There are probably others I didn't list. Go try them out.

One obvious way to get better with Vim-git integration is to read more about git. Git, on its own, is a vast topic and I am only showing a fraction of it. With that, let's *git going* (pardon the pun) and talk about how to use Vim to compile your code!

## Link
- Prev [Ch17. Fold](./ch17_fold.md)
- Next [Ch19. Compile](./ch19_compile.md)
4 changes: 4 additions & 0 deletions ch19_compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,7 @@ Now each time you enter a file (`BufEnter`) that ends with `_spec.rb`, running `

In this chapter, you learned that you can use the `make` and `compiler` commands to run *any* process from inside Vim asynchronously to complement your programming workflow. Vim's ability to extend itself with other programs makes it powerful.


## Link
- Prev [Ch18. Git](./ch18_git.md)
- Next [Ch20. Views, Sessions, and Viminfo](./ch20_views_sessions_viminfo.md)
5 changes: 5 additions & 0 deletions ch20_views_sessions_viminfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,8 @@ There are other options that you can pass. To learn more, check out `:h 'viminfo
Vim has View, Session, and Viminfo to take different level of your Vim environment snapshots. For micro projects, use Views. For larger projects, use Sessions. You should take your time to check out all the options that View, Session, and Viminfo offers.

Create your own View, Session, and Viminfo for your own editing style. If you ever need to use Vim outside of your computer, you can just load your settings and you will immediately feel at home!

## Link
- Prev [Ch19. Compile](./ch19_compile.md)
- Next [# Multiple File Operations
](./ch21_multiple_file_operations.md)
4 changes: 4 additions & 0 deletions ch21_multiple_file_operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,7 @@ Knowing how to do a multiple file operation is a useful skill to have in editing
Practically speaking, you probably won't use all eight equally. You will gravitate towards one or two. When you are starting out, pick one (I personally suggest starting with the arg list `:argdo`) and master it. Once you are comfortable with one, then learn the next one. You will find that learning the second, third, fourth gets easier. Be creative. Use it with different combinations. Keep practicing until you can do this effortlessly and without much thinking. Make it part of your muscle memory.

With that being said, you've mastered Vim editing. Congratulations!

## Link
- Prev [Ch20. Views, Sessions, and Viminfo](./ch20_views_sessions_viminfo.md)
- Next [Ch22. Vimrc](./ch22_vimrc.md)
5 changes: 5 additions & 0 deletions ch22_vimrc.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,8 @@ vim --clean
## Configure Vimrc the Smart Way

Vimrc is an important component of Vim customization. A good way to start building your vimrc is by reading other people's vimrcs and gradually build it over time. The best vimrc is not the one that developer X uses, but the one that is tailored exactly to fit your thinking framework and editing style.

## Link
- Prev [# Multiple File Operations
](./ch21_multiple_file_operations.md)
- Next [Ch23. Vim Packages](./ch23_vim_packages.md)
4 changes: 4 additions & 0 deletions ch23_vim_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,7 @@ The answer is, as always, "it depends".
I still use vim-plug because it makes it easy to add, remove or update plugins. If you use many plugins, it may be more convenient to use plugin managers because it is easy to update many simultaneously. Some plugin managers also offer asynchronous functionalities.

If you are a minimalist, try out Vim packages. If you a heavy plugin user, you may want to consider using a plugin manager.

## Link
- Prev [Ch22. Vimrc](./ch22_vimrc.md)
- Next [Ch24. Vim Runtime](./ch24_vim_runtime.md)
4 changes: 4 additions & 0 deletions ch24_vim_runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,7 @@ Try this yourself: create an arbitrary path and add it to your runtimepath. Add
## Learn Runtime the Smart Way

Take your time reading it and play around with these runtime paths. To see how runtime paths are being used in the wild, go to the repository of one of your favorite Vim plugins and study its directory structure. You should be able to understand most of them now. Try to follow along and discern the big picture. Now that you understand Vim directory structure, you're ready to learn Vimscript.

## Link
- Prev [Ch23. Vim Packages](./ch23_vim_packages.md)
- Next [Ch25. Vimscript Basic Data Types](./ch25_vimscript_basic_data_types.md)
4 changes: 4 additions & 0 deletions ch25_vimscript_basic_data_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -789,3 +789,7 @@ Similar to `v:none`.
In this chapter, you learned about Vimscript's basic data types: number, float, string, list, dictionary, and special. Learning these is the first step to start Vimscript programming.

In the next chapter, you will learn how to combine them for writing expressions like equalities, conditionals, and loops.

## Link
- Prev [Ch24. Vim Runtime](./ch24_vim_runtime.md)
- Next [Ch26. Vimscript Conditionals and Loops](./ch26_vimscript_conditionals_and_loops.md)
4 changes: 4 additions & 0 deletions ch26_vimscript_conditionals_and_loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,7 @@ Now if you `source` vimrc without `gruvbox` directory, Vim will use the `colorsc
In the previous chapter, you learned about Vim basic data types. In this chapter, you learned how to combine them to write basic programs using conditionals and loops. These are the building blocks of programming.

Next, let's learn about variable scopes.

## Link
- Prev [Ch25. Vimscript Basic Data Types](./ch25_vimscript_basic_data_types.md)
- Next [Ch27. Vimscript Variable Scopes](./ch27_vimscript_variable_scopes.md)
4 changes: 4 additions & 0 deletions ch27_vimscript_variable_scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,7 @@ There are other variables. For a list of Vim built-in variables, check out `:h v
Being able to quickly access environment, option, and register variables give you a broad flexibility to customize your editor and terminal environment. You also learned that Vim has 9 different variable scopes, each existing under a certain constraints. You can take advantage of these unique variable types to decouple your program.

You made it this far. You learned about data types, means of combinations, and variable scopes. Only one thing is left: functions.

## Link
- Prev [Ch26. Vimscript Conditionals and Loops](./ch26_vimscript_conditionals_and_loops.md)
- Next [Ch28. Vimscript Functions](./ch28_vimscript_functions.md)
4 changes: 4 additions & 0 deletions ch28_vimscript_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,3 +524,7 @@ Now if you run `echo Lunch()()`, Vim will return "shrimp".
In this chapter, you learned the anatomy of Vim function. You learned how to use different special keywords `range`, `dict`, and `closure` to modify function behavior. You also learned how to use lambda and to chain multiple functions together. Functions are important tools for creating complex abstractions.

Next, let's put everything that you have learned together to make your own plugin.

## Link
- Prev [Ch27. Vimscript Variable Scopes](./ch27_vimscript_variable_scopes.md)
- Next [Ch29. Write a Plugin: Creating a Titlecase Operator](./ch29_plugin_example_writing-a-titlecase-plugin.md)
3 changes: 3 additions & 0 deletions ch29_plugin_example_writing-a-titlecase-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -900,3 +900,6 @@ Finally, if you are writing your own plugin locally at first and you want to tes
You made it to the end! This chapter is the amalgamation of all the Vimscript chapters. Here you are finally putting to practice what you've learned so far. Hopefully having read this, you understood not only how to create Vim plugins, but also encouraged you to write your own plugin.

Whenever you find yourself repeating the same sequence of actions multiple times, you should try to create your own! It was said that you shouldn't reinvent the wheel. However, I think it can be beneficial to reinvent the wheel for the sake of learning. Read other people's plugins. Recreate them. Learn from them. Write your own! Who knows, maybe you will write the next awesome, super-popular plugin after reading this. Maybe you will be the next legendary Tim Pope. When that happens, let me know!

## Link
- Prev [Ch28. Vimscript Functions](./ch28_vimscript_functions.md)