vim

Alignment of current line number in Vim

心已入冬 提交于 2020-12-05 05:35:14
问题 In Vim I am using relative line numbering and in my .vimrc have highlight CursorLineNr ctermfg=LightGray to make the current line number stand out a bit more. I was wondering if it's possible to also change the alignment of the current line number? By default it's aligned to the left, but I would like to have it align to the right like the other numbers. 回答1: The combination of number and rnu option will change the display of line numbers. If you have nonu and rnu , then the current line

Alignment of current line number in Vim

拟墨画扇 提交于 2020-12-05 05:33:32
问题 In Vim I am using relative line numbering and in my .vimrc have highlight CursorLineNr ctermfg=LightGray to make the current line number stand out a bit more. I was wondering if it's possible to also change the alignment of the current line number? By default it's aligned to the left, but I would like to have it align to the right like the other numbers. 回答1: The combination of number and rnu option will change the display of line numbers. If you have nonu and rnu , then the current line

In Vim, how to search and replace in current line only?

会有一股神秘感。 提交于 2020-11-30 21:06:16
问题 I see how to search and replace in specific lines, specifying by line number, and how to search and replace using the current line as reference to a number of lines down. How do I search and replace in the current line only? I'm looking for a simple solution that does not involve specifying line numbers as the linked solutions do. 回答1: Replace all occurrences of str1 with str2 in certain line: :s/str1/str2/g remove the g option if you want to replace only the first occurrence. 回答2: You can

In Vim, how to search and replace in current line only?

試著忘記壹切 提交于 2020-11-30 21:05:58
问题 I see how to search and replace in specific lines, specifying by line number, and how to search and replace using the current line as reference to a number of lines down. How do I search and replace in the current line only? I'm looking for a simple solution that does not involve specifying line numbers as the linked solutions do. 回答1: Replace all occurrences of str1 with str2 in certain line: :s/str1/str2/g remove the g option if you want to replace only the first occurrence. 回答2: You can

In Vim, how to search and replace in current line only?

喜欢而已 提交于 2020-11-30 20:56:16
问题 I see how to search and replace in specific lines, specifying by line number, and how to search and replace using the current line as reference to a number of lines down. How do I search and replace in the current line only? I'm looking for a simple solution that does not involve specifying line numbers as the linked solutions do. 回答1: Replace all occurrences of str1 with str2 in certain line: :s/str1/str2/g remove the g option if you want to replace only the first occurrence. 回答2: You can

In Vim, how to search and replace in current line only?

冷暖自知 提交于 2020-11-30 20:55:21
问题 I see how to search and replace in specific lines, specifying by line number, and how to search and replace using the current line as reference to a number of lines down. How do I search and replace in the current line only? I'm looking for a simple solution that does not involve specifying line numbers as the linked solutions do. 回答1: Replace all occurrences of str1 with str2 in certain line: :s/str1/str2/g remove the g option if you want to replace only the first occurrence. 回答2: You can

In Vim, how to search and replace in current line only?

北慕城南 提交于 2020-11-30 20:55:08
问题 I see how to search and replace in specific lines, specifying by line number, and how to search and replace using the current line as reference to a number of lines down. How do I search and replace in the current line only? I'm looking for a simple solution that does not involve specifying line numbers as the linked solutions do. 回答1: Replace all occurrences of str1 with str2 in certain line: :s/str1/str2/g remove the g option if you want to replace only the first occurrence. 回答2: You can

What is the difference between gVim and gVim easy?

倖福魔咒の 提交于 2020-11-30 09:10:01
问题 The question is self explanatory, but I haven't found a single resource that explains what the difference is after an hour of searching. After poking around a little bit in both, it appears that gVim and gVim easy are identical. 回答1: Gvim easy is started and locked in insert-mode (every character you type is printed like a simple notepad). Standard gvim starts in normal mode and you have to toggle between normal/insert like all other vim. From help: Easy mode. Implied for |evim| and |eview|.

What is the difference between gVim and gVim easy?

≯℡__Kan透↙ 提交于 2020-11-30 09:03:32
问题 The question is self explanatory, but I haven't found a single resource that explains what the difference is after an hour of searching. After poking around a little bit in both, it appears that gVim and gVim easy are identical. 回答1: Gvim easy is started and locked in insert-mode (every character you type is printed like a simple notepad). Standard gvim starts in normal mode and you have to toggle between normal/insert like all other vim. From help: Easy mode. Implied for |evim| and |eview|.

Getting the current row number?

萝らか妹 提交于 2020-11-30 03:43:13
问题 Is there any key mapping that outputs the current row number of the line being edited? Or, even better yet, can we do formulas based on the output of the key mapping? I want to get the row number and add 1 to the current text being edited. 回答1: Ctrl + G will tell you the line number and even the column the cursor is in. If you mean output it as text to your document, then not that I know of. 回答2: What do you mean by "output"? You can do: :echo line(".") + 1 To display the current line number