Tag Info

Hot answers tagged

10

Just because you ran vi demo.c does not mean a file demo.c was created. It isn't created until you write the buffer to disk for the first time. Simply write the buffer to disk before compiling: :w This is confirmed by the message [No write since last change] you see. This message means the buffer changed (in that you created the buffer called demo.c) ...


4

Means folk can leverage this to get a root shell, thereby bypassing your security, eg :!/bin/sh from within vim. Or :r /etc/shadow and :w /etc/shadow. And so on...


4

You must search for <td>n. The escaped version searches for a single isolated word td followed by n. \<word\> pattern is useful for searching words even when they are separated by other stuff than whitespace or appear at the beginning or end of the line. So try: /<td>name=


2

network conditions. To detect if your network conditions are good exit to shell on remote machine and hold any character key. If you see that character flow is unstable or 'hangs' you have network problems. vim does autosave and target disk if NFS or something like that. To detect Either use sar to get data from the past or run vmstat in other ssh session ...


2

I'm sure this is a duplicate but: gg"*yG gg go to the first line "*y start a yank to the system clipboard "register" G move to the end of the file (you will see how many lines were yanked)


2

The dict attribute is dispensable in this case, because defining and assigning function directly to dictionary implied dict attribute for function, using dict attribute is not necessary anymore. That type of functions are called anonymous-function or numbered-function. In your example, you have defined two ClassZ keys, Change_author_name and ...


2

In command mode: :put =string(L) string(expr) function convert expr to a String. See :help string() for more details.


2

You can insert CTRL-V somewhere in the abbreviation to avoid the abbreviation occur. After typing :una ma, press Ctrl+v twice, then typ in, your command mode now look like this: :una ma^Vin Press Enter and the abbreviation was gone. It's better if you only define abbreviation in which mode you want to operate. In your case, using iab to make main only ...


1

You might want to use rvim or vim -Z to avoid the trivial root shell escape. Personally I'd write a short script that allowed the user to edit just the necessary files. Then, if any changes were detected it could offer to restart the Apache server, too. The script could even make automatic backups.


1

It appears vimtex adds its own custom highlighting. I turned off the background for these: highlight texMathMatcher ctermbg=none highlight texMathZoneX ctermbg=none highlight texRefLabel ctermbg=none highlight texStatement ctermbg=none Feel free to let me know if there is a more elegant solution.


1

vim regex engine support Bracket Expression, you can defined a class of characters as a sequence of characters enclosed by square brackets [...]: /[+\-*/%(=]/ will match any character from those characters (You need to escape -, which defined a range between characters, to match it literally) To check current line contains any in set of characters: if ...


1

Type :w !xsel -b to copy the visual selection. When you press : while the visual selection is active, this inserts a range that designates the visual selection, so you'll end up executing :'<,'>w !xsel -b. This copies all lines that are partially or completely selected, i.e. line where the selection starts and the line where the selection ends are ...


1

I stumbled across your question while having the same problem and I've found a solution. I assume that, you as well as I installed cscope_maps.vim in your .vim directory. When you inspect the file exactly it has a flag "cscopetag" that basically combines ctags and csope. Removing this flag will disable ctrl-] binding for cscope and only ctags remains. *" ...


1

I did itusing a bit of a hackier way: Using tcsh I put the following in my .cshrc # escape sequence to set the screen title alias stitle 'echo -n "^[k\!*^[\\"' # shorthand to set the screen title to the hostname alias H stitle `hostname -s` # shorthand to set the screen title to the filename, launch vim, and then set it back alias ...



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