Hot answers tagged

2

The problem is not the wildcards. It is that each file is opened in a buffer, and you cannot use :wq to exit a buffer. You could use :w|bd to save the current buffer and unload it. I find it clumsy, though. Much better is to add the -p flag when invoking Vim: vim -p webform.webform.* This causes each file to be opened in a new tab, and then you can use the :...


2

Short answer xmodmap -e 'keycode 38 = a A a A Left' xmodmap -e 'keycode 40 = d D d D Right' xmodmap -e 'keycode 25 = w W w W Up' xmodmap -e 'keycode 39 = s S s S Down' Write those lines in any graphical environment startup script. Detailled answer One can remap keyboard events using the xmodmap command. As an exemple if you want to remap Altr Gr + a to ...


1

On all modern operating systems, any binary file is going to be stored and handled as a series of bytes (that is, 8-bit groups). In fact, any text file will also be stored this way. In most cases, text editors (or binary file editors) are designed to show bytes because they are the unit of storage. If I want to edit a binary file to contain a different ...


1

I use something similar to this function, which allows me to edit the crontab file in the way that you want, committing changes only once I've written out the file vicrontab() { local cf="$HOME/.crontab" md5 crontab -l >"$cf" md5=$(md5sum "$cf") "${VISUAL:-${EDITOR:-vi}}" "$@" "$cf&...


1

I don't know what distribution you are using, but in Debian at least the source code just gets VISUAL or EDITOR, appends the filename and forks. So in that case no, you cannot pass additional parameters from the command line to your editor when using crontab -e. You could rebuild the VISUAL or EDITOR variables each time though, as another answer suggests.


1

Put the target filename under the cursor and press gf. You can also do it with visual selection, such that, in the line below, I want to open xfilex without the exes! if you want to open file (not xfilex), then visually select file and press gf. Find more information with :help gf: [count]gf Edit the file whose name is under or after the cursor. ...


1

You could use read to read the output of a command: :read !sort file.txt | uniq -c (! means this is shell command) Which would read the output of the command and insert it after the cursor, then you could save it as a file. But you could also do this (as @Panki mentioned): sort file.txt | uniq -c > new_file.txt Which would do what you want, but skip the ...


1

You could use: %s/\(\d\+\)\@<=:/!/g \(\d\+\) Find a decimal number \@<= Apply a positive look-behind. A positive look-behind means that the previous pattern ( in this case the one above ) is required to match on the next symbol. You can read more how VIM implements this here. : Match on ':'.


1

Flatpak app can run only executables provided by it and its runtime (org.kde.Sdk/x86_64/5.14 in case of org.octave.Octave). Nano is available in org.kde.Sdk. Neither Vim nor Emacs are available there. You can run host program from Flatpak container using flatpak-spawn --host. See How to allow GUI application in flatpak to run CLI tool?. I run Octave in ...


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