vi

yamlfix not using configuration + (neo)vim usage

yamlfix not using configuration + (neo)vim usage I’m using yamlfix with ale in vim. I followed these steps because I wanted to remove the automatic "—" adding on top of the file every time I save my work (and some others default configurations). For some reason, the file is correctly fixed, but my configuration is …

Total answers: 1

`ZQ` does not work on vi version installed on FreeBSD

`ZQ` does not work on vi version installed on FreeBSD When I open a file with the default vi on FreeBSD and press the buttons ZQ (close without saving) it tells me Usage: ZZ. But ZZ saves any modifications and I don’t want that. :q! works, though. :version Version 2.2.0 (2020-08-01) The CSRG, University of …

Total answers: 1

How to edit UTF-8 files with vim

How to edit UTF-8 files with vim How can I edit UTF-8 files with vim? There is a problem with german special characters like ‘Ä’, ‘ü’. There are some in the comments. vim shows Ã~D instead of ‘Ä’ and ü instead of ‘ü’ then. (I hope there is no encoding problem on your browser 🙂 …

Total answers: 2

How to edit a list of generated files whose names contain spaces

How to edit a list of generated files whose names contain spaces I’ve got a relatively small list of filenames generated from a pipeline based on find. The file names contain spaces and possibly punctuation but definitely no other non-printing characters or newlines. For example, Netherlands/Purge (GDPR) 2020-01-09.txt Netherlands/Purge (GDPR) 2020-01-27.txt Switzerland/New mailing 2020-01-27.txt I …

Total answers: 5

Disabling vim visual mode in /etc/vim/vimrc does not work

Disabling vim visual mode in /etc/vim/vimrc does not work I found plenty of questions regarding disabling visual mode in vim but none that tackles my particular problem: I added set mouse-=a to my /etc/vim/vimrc file to disable visual mode for good. Thing is: That seems to do nothing. However when I put the exact same …

Total answers: 4

How to install vi (not vim)?

How to install vi (not vim)? How do I install the vi editor in Ubuntu 18.04? I want to try vi, not vim. I am just curious to see how it works. Thanks! Asked By: eeze || Source To install vi in all currently supported versions of Ubuntu open the terminal and type: sudo apt …

Total answers: 3

How to set and determine the command-line editing mode of Bash?

How to set and determine the command-line editing mode of Bash? How to set the vi or emacs command line editing mode the Bash AND how to determine which mode is currently set? Asked By: Blcknx || Source To set: set -o vi Or: set -o emacs (setting one unsets the other. You can do …

Total answers: 3

Opening most recently modified file in vim

Opening most recently modified file in vim The following commands work $ ls -1t | head -1 git_sync_log20180924_00.txt $ vi git_sync_log20180924_00.txt But this does not $ ls -1t | head -1 | vi Vim: Warning: Input is not from a terminal Vim: Error reading input, exiting… Vim: preserving files… Vim: Finished. How can I accomplish …

Total answers: 3

vi – How go to line N?

vi – How go to line N? In vi editor how do I go to a particular line? For example if I open a file named file.py is there an option for open the file at a particular line, or can I open my file and then go to line with keyboard shortcut? Asked By: …

Total answers: 1

Find any line in VI that has something other than ATCG

Find any line in VI that has something other than ATCG I have a file of genomic data that is approximately 5 million lines long and should have only the characters A, T, C, and G in it. The problem is, I know how large the file should be, but it’s slightly larger than that. …

Total answers: 2

Vim: cw & dw whitespace inconsistency

Vim: cw & dw whitespace inconsistency vim seems to treat whitespace differently when using cw (change word) and dw (delete word). For instance with the example text below, if the cursor is over the letter a and I type dw, it will remove the remainder of the word and the space after, while if I …

Total answers: 2

What is '@!' file?

What is '@!' file? I have a filename @! in my home folder. When I open it, it has the same content that my other bash file myscript.sh has. I have not assign execute permission to original bash file. When I have checked properties, the only difference between two file is size. Original file size …

Total answers: 1

E325: ATTENTION swap file already present error in Vi

E325: ATTENTION swap file already present error in Vi I have changed my environment variables before now. When I am trying to use the following command: sudo vi /etc/environment I am getting following warning/error and I am confused about what to do next. E325: ATTENTION Found a swap file by the name “/etc/.environment.swp” owned by: …

Total answers: 1

Incorrect UTF-8 accents in vi/vim on OpenBSD 6.2

Incorrect UTF-8 accents in vi/vim on OpenBSD 6.2 After a default install of OpenBSD 6.2 with FVWM, I open an xterm on the FVWM GUI, with normal user, create a test file: $ echo ‘árvíztűrő tükörfúrógép’ > test.txt $ echo ‘ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP’ >> test.txt $ $ cat test.txt árvíztűrő tükörfúrógép ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP $ $ locale …

Total answers: 2

What editor can I use as a simple vi/vim alternative?

What editor can I use as a simple vi/vim alternative? I’m a Windows user coming to Ubuntu’s Bash thanks to WSL. Now I need to edit some files and I really hate Vi. Do I just have to deal with it, or is there a simpler alternative? The features I am looking for are: CLI …

Total answers: 9

How to set bash readline to vi mode automatically upon login to a system?

How to set bash readline to vi mode automatically upon login to a system? My team is responsible for thousands of Linux/Unix machines, so naturally the root account is “shared” amongst the admins. I prefer vi mode, others prefer emacs mode. How can I set bash’s readline to vi mode upon SSH login to any …

Total answers: 5

Is it possible to hit Shift-k and open a manual for a command in Bash?

Is it possible to hit Shift-k and open a manual for a command in Bash? In Vim you can hit Shift–k and open a manual for a string under the cursor. Is it possible to configure Bash this way as well (when using set -o vi)? For example: # ‘|’ represents the position of a …

Total answers: 3

Use of touch and vi?

Use of touch and vi? Is there a benefit of creating a file with touch prior to edit.. like: touch foo vi foo versus getting it to editor straight-away? Like: vi foo I see quite a few tutorials using the former (touch then vi). Asked By: Fawix || Source There’s no benefit. vi will create …

Total answers: 11