Tag Info

Hot answers tagged

5

Generally, @ represents a symbolic link. There are certain relatively standard format indicators often appended to a filename when displaying it in a list of files, to let you quickly have some idea what it is; I'm not sure if they originated with ls, but ls -F has a nice list of them: / is a directory, @ is a symbolic link (meaning the file is really ...


4

Because Vim is a well-maintained, vi-compatible, Open Source editor, so it is a perfect match for Linux. I've last seen implementations of pure "vi" on proprietary Unixes like SunOS, HP-UX, AIX; you might get "lucky" on BSD, too. (But of course Vim can be installed on those, too.) On Ubuntu, what gets installed by default is a stripped-down version of Vim ...


4

While :e is the correct answer to the question you asked, if the goal is to tail a log with good scrollback, you can use less. F while viewing a file will scroll Forward, with continuous reloading. From the man page: F Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when ...


4

One option would be to use exe: exe ":function! SomeFunc() \n return 0 \n endfunction" The \n characters are interpreted as newlines by the double-quoted strings. This does mean you should be careful to escape any special sequences. That said, I want to be able to simply copy and paste the function! command and press Enter... As romainl mentioned, ...


3

After you type : to enter on command mode, or after your insert your command, type CTRL+f. Your history of commands will appear in a new "command-line window". Once there, you could use D from the point where you want to start to delete. Then just type ↩ to execute your command.


3

Not really. You could do something like this; a compound command line instruction: > myfile.txt && vim myfile.txt The > myfile.txt would wipe the contents of the file—but leave the actual file in place—and the && then ties that command to vim myfile.txt.


3

vim is the sucessor to vi. It stands for vi improved. /usr/bin/vi is just a symlink to vim. You can see this with: ls -l /usr/bin/vi To start "classic vi": vim -u NONE myText.txt How it works: vim looks for a config file at ~/.vimrc, if this is found it will run as vim unless the line set compatibility appears in .vimrc. To save editing the .vimrc ...


2

Those letters are only there to show you additional information about the item on the left; they can't be used for selection. See :help neocomplete for an explanation. You navigate the default completion menu with <Down> and <Up> and select the highlighted item with <C-y>. See :help popupmenu-keys. Again, read your plugin's documentation ...


2

In Emacs, there's a package to do just that called follow-mode.


2

You will need search for that: c/[_-]<CR> " forward search c?[_-]<CR> " backward search


2

To wipe file you may use: $ vim +%d +w file But that’s not a recreation (removing file and creating new one), a file remains the same (same inode). I guess, there is no difference for you, right? If I’m wrong and you need a new file, I’m afraid, you have to use shell and rm: $ rm file && vim +w file


2

You're right, the downside of :cmap is that it applies to all command-line modes, so it prevents you from searching for those strings, too. One solution is to check the type of command-line mode, via an expression mapping: cnoremap <expr> w1 getcmdtype() == ':' ? 'w!' : 'w1' If you're clever, you can do meta-programming and define all your mappings ...


2

set clipboard^=unnamedplus See :help 'clipboard'. I don't care about clobbering the system clipboard, because there are tools I use to record past clipboard entries. I just want a way to yank to clipboard which is easy enough to perform that I may actually make use of it. Clobbering the system clipboard is precisely a rather big issue with ...


1

There isn't a default shortcut mapping to do what you asked for. A full documentation of command mode editing can be found through :help cmdline-editing. You are welcomed to browse through it to find anything useful to you. But I don't think the function you asked for is in it. I guess the default way of editing of command-line doesn't require such ...


1

Ctrl + arrow keys in vim are not assigned: all vim is doing is processing the raw characters. You skip one word to the left/right with the command (not in insert mode, of course) b/w. You can find a cheat sheet for Linux vim/vi editor here.


1

Vim evaluates your expression from left to right, so it first concatenates "Z" and the match, then subtracts 87 from the string (which yields 0). This can be fixed with parentheses: :%s/Z\(\d\d\)/\="Z".(submatch(1)-87)/ To be more explicit (and handle decimal numbers that start with 0), you can throw in str2nr(), like this: ...


1

This is a perfect use case for macros: qq JJJj q then: 100@q or: :%norm! @q But you can also use your mapping with :normal too: :%norm <C-v><F5> <-- press Ctrl+V then F5


1

It was missing: set encoding=utf8 on my .vimrc.


1

You correctly first specified the proper (UTF-8) encoding. This turned the three-byte sequences into a single Unicode character. The ga command can show you codepoint information about the character under the cursor. For “Host”, these are U+201C (Left double quotation mark) U+201D (Right double quotation mark) The problem is that your chosen font ...


1

Indirectly, you might get close to what you want by writing to a file and have both vim and your other application setup to autoreload on changes to the file. vim Can be configured to autoreload but it depends on your other application if it offers that functionality.


1

You could use terminator. Open terminal, split it in half so that you have 2 terminals open. Then open 2 different files using different applications, and use the "broadcast" feature on terminator.


1

Instead of pressing ^ you can press _(underscore) to jump to the first non-whitespace character on the same line the cursor is on. + and - jump to the first non-whitespace character on the next / previous line. (These commands only work in command mode, not in insert mode.)


1

Try install Input Mono Font (v.1.1 or higher) and you don't need patched font. You can grab in http://input.fontbureau.com. Version 1.1 (2014‑09‑03) Added glyphs for Powerline characters        (U+E0A0–E0A2, U+E0B0–E0B3). Added glyph for high voltage sign character ⚡ (U+26A1). Added alternate curly bracket glyphs  for users who prefer ...


1

What you describe as a convention is an honorable goal, at best, but definitely not a convention. Vimmers usually have one or several long-running project-specific sessions with potentially dozens of buffers and short-lived sessions for quick edits. The idea is to keep related buffers together and avoid mixing unrelated concerns. Adding buffers to the ...


1

You can create a mapping to do this xnoremap : :<c-u><c-r>=line("'<")<cr>,<c-r>=line("'>")<cr> When you hit : in visual mode it will delete the '<,'> that is normally put there with <c-u>. Then it will insert the line number for the '< and '> marks separated by a comma. It does this with ...


1

The parsing of the quickfix entries is determined by the 'errorformat' option. This supports two different column meanings (from :help errorformat): %c column number (finds a number representing character column of the error, (1 <tab> == 1 character column)) %v virtual column number (finds a number ...


1

Version 141216 fixes your issue. BTW, your workaround is not needed anymore, but using several keys GuiMacro function is not optimal, better use sort of keys("^[","[","Z") or just print("\e[Z").


1

The lifespan of SSD drives is only impacted by writes (as this causes memory cells to be reorganized and rewritten); for subsequent reads, your tags file is probably cached by your operating system in RAM, anyway. If you're using anything except first generation hardware, I don't think you need to worry about this. The disks have advanced wear-leveling ...



Only top voted, non community-wiki answers of a minimum length are eligible