Questions tagged [vim]

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.

Filter by
Sorted by
Tagged with
0 votes
0 answers
34 views

Vim/Nvim Remote Editing

I want to work from my local nvim client on a project on a remote machine. My job requires that I don't store any source code on my local machine and only work on remote (I think writes to /tmp are ...
54 votes
4 answers
40k views

Vim: how to paste a block of text at the end of multiple lines?

Say I have a block of text like this: // Comment1 // Comment2 // Comment3 And I want to append each of these lines to the end of 3 corresponding lines of code: foo = 1; bar = 2; baz = 3; So that ...
8 votes
3 answers
2k views

How can I get a navigable (editable?) buffer with vim's `messages`?

So, if I get an error from a plugin, I'd like to be able to report that error on GitHub or similar. Unfortunately, it's not mouse-selectable; and after appearing and asking me to hit RETURN, it seems ...
15 votes
8 answers
90k views

How do you run Vim in Windows?

I just installed gVim, and tried using the usual "vim myfile.java" technique that usually works for linux to open up a file and edit it. But unfortunately, this doesn't seem to work. I've also tried "...
0 votes
0 answers
20 views

Encoding issues over SSH characters shown as ~@~X in vim

I am having issues when viewing a file through SSH I have 2 computers connected to each other myServer 'myHost' , sharing over 'SSH' a session. On myServer I have got a log from wget which originates ...
4 votes
3 answers
3k views

software development under chromeOS?

Will I be able to do software development (scala, java, python, ruby, etc.) when I'm using the chromeOS? What are the development environments gonna be like? Currently I use vim, bash, and eclipse ...
1 vote
0 answers
25 views

Use Vim to edit Applescript file

Is it possible to use Vim to work on applescript files rather than the default Automator or Script Editor program? I searched the webs and couldn't find the same question or an answer anywhere. I ...
39 votes
3 answers
96k views

Vim: show line feeds & carriage-return

How can I display line feeds and/or carriage-return characters in vi/vim? I know that set list shows all the whitespace characters (?), it also replaces tabs \t etc (but that's not what I want). ...
30 votes
3 answers
22k views

Vim: change label for specific tab

Say I have a bunch of tabs open in Vim, with a tabline looks something like this: 1 v/file1.py 2 t/file.py 1 t/file.py 1 o/otherfile.py See how two tabs both say "t/file.py"? Those are different ...
5 votes
3 answers
2k views

Gvim paste using Control+Shift+V, while leaving Visual Block Mode Control+V

Is there a way to map paste to control+shift+v, and leave visual block mode as control+v in gvim? I use both quite often.
52 votes
6 answers
19k views

How do I copy command output in vim?

For example, if I type ':pwd' to get the current working directory, I can select the text in gvim but I can't figure out how to copy it to the clipboard. If I try the same in console vim, I can't even ...
20 votes
6 answers
15k views

Go to middle of line in Vim

I know 0 goes to the beginning of a line and $ goes to the end, but is there something for the middle?
21 votes
5 answers
9k views

Setting vim options only for files in a certain directory tree?

There is a programming project I work on where everyone else uses a tabsize of 4, so I find it most straightforward to set tabstop=4 in my ~/.vimrc. However, I'd rather not have this affect every file ...
1 vote
1 answer
615 views

Why does GNU Screen cause me to have to press Esc twice in Vim?

When I launch GNU Screen and then open Vim, to get out of "insert mode", I have to press the Escape key twice, whereas in Vim outside of Screen I only have to press it once. Why does this ...
0 votes
0 answers
45 views

How do scroll up with a number of lines at a time with tmux?

I have my tmux set up for scrolling using vim shortcuts. I can go up a page at a time. However, I am faced with a very long test failure log. I went up once with Ctrl+U multiple times and realized ...
1 vote
1 answer
70 views

vim 7.4.576: how does one delete and save to register with :g?

How can one delete all lines matching a pattern and save them to a register for pasting them somewhere else in the file? I tried :g/pattern/"xd and :g/pattern/normal "xd The first one gave an ...
0 votes
0 answers
19 views

MacVim doesn't open a window (except from Terminal, and then only one window)

If I start MacVim from the dock, it launches, but it doesn't have an open window. File / New Window and File / New Clean Window are grayed out (and of course don't do anything). If I start MacVim from ...
1 vote
0 answers
69 views

Issue with Ctrl + Arrow Keys in (Neo)vim using PuTTY

When I establish a SSH connection to my machine using PuTTY, I find that the Control + Arrow keys behave unexpectedly when working with vim or nvim in the bash terminal. For instance, in Vim, escaping ...
2 votes
4 answers
6k views

Vim sync to remote on save

I'm looking for a plugin or script that works similarly to Sublime SFTP Basically, it should contain a configuration file and map the local and remote hierarchy. On save to a file, it should be able ...
1 vote
3 answers
5k views

Open file with bash on Windows

I have neovim installed in the WSL. To access it, I open ConEmu, which is set up to use the WSL Bash by default as soon as it opens On Windows there are often times where I want to make some quick ...
0 votes
0 answers
19 views

I am trying map right to end in my .obsidian.vimrc

I am trying to remap right in normal mode in my .obsidian.vimrc to jump to the end of a line. Things I have tried nmap <RIGHT> <END> I did not use $ as I wanted it to jump to the end of ...
0 votes
0 answers
18 views

Esc fails on vim via ssh through git bash

I am a heavy user of vim and, by extension, the Esc key. Today, for the first time, I've noticed that it sometimes sends a literal [ to the screen instead of changing to command mode as it should. ...
0 votes
0 answers
16 views

How to break a paragraph with footnotes via \autocite{} into sentences in nVim?

This question is similar to the one asked here. I'm trying to figure out how to break paragraphs written in a TeX file in Nvim so that: any sentences with a citation (i.e. \autocite[][]{}) after them ...
1 vote
0 answers
18 views

Trying to get tab in normal mode(VSCode using the vscode-neovim extension) to move to new cell in a markdown table

I'm seeking assistance with the VSCode-Neovim extension to enhance navigation in markdown tables. The current markdown extension that I am using is takumisoft68/vscode-markdown-table, which has this ...
10 votes
3 answers
7k views

Is there any simple tmux/screen alternative?

I would like to connect to a terminal session/application running on different computer but without usage of terminal multiplexer as tmux or screen. I don't need split windows or sharing the terminal ...
14 votes
6 answers
11k views

Vim copy/paste messing up indentaton

Whenever I copy something from another application and then go to paste it into vim, it messes up the indentation. For example, just now I tried to copy the manifest.json file from the hello-world ...
2 votes
1 answer
79 views

VIM uses wrong encoding - but only in status messages

I ran into a strange issue with my ArchLinux setup. Vim uses correct encoding for reading/displaying files but these status messages (which displays the current mode or reports back when the buffer is ...
16 votes
4 answers
15k views

How do I show Filename, Line Count, and Character Count in vim?

When you first launch vim with vim myfile.c, in the bottom-left of the screen it shows the filename in quotes, the number of lines, then the character count. It disappears the minute something else ...
22 votes
9 answers
60k views

Vim enclose in quotes

Say I have the following printf(text goes here); and I select "text goes here" in visual mode... How do I quickly change it to printf("text goes here");
3 votes
3 answers
5k views

Vim + iTerm2 color issues

I have trouble with the right Vim configuration. I'm using the latest version of Vim as well as the latest version of iTerm2. I try to get the solarized colorscheme working, but without luck so far. ...
9 votes
3 answers
6k views

Join lines between a certain text pattern in Vim

I have a text file which looks like this: A. text text text A. more text more text A. more text I want to join all lines between the "markers" A. so that it looks like: A.texttexttext A.more ...
7 votes
1 answer
415 views

Possible to use modal editing inside Vim's command-line mode?

Vim's normal and insert modes are wonderful. A source of constant frustration for me is that whenever I enter command-line mode for entering Ex commands (by pressing :) suddenly I lose all the ...
0 votes
1 answer
4k views

Spawning language server with cmd: `lua-language-server`

I've recently transferred from Packer plugin manager to Lazy. Utilizing LSP, LspConfig, Mason, MasonLspConfig with several language servers for programming. The problem is that Neovim is having ...
4 votes
4 answers
1k views

How to type # in vim with a British keyboard layout on OS X

My Mac has a British keyboard layout and the # symbol is entered with option-3, instead of shift-3 as with the US layout. This arrangement, though odd, works fine most of the time. However, when ...
4 votes
2 answers
3k views

Vim isn't recognizing my vimrc file

I'm attempting to copy over my local vimrc configuration to a new linux server I've just set up: scp -rp .vim/ nagios:~ scp .vimrc nagios:~ Then, with ls -hoal on the remote machine in my ~ ...
7 votes
2 answers
1k views

When editing an existing file with Vim, will it replace or change that file?

I've read that most editors will replace the file when you actually want to save changes to that file: How to execute a command whenever a file changes? How does Vim behave?
1 vote
2 answers
8k views

How to config YouCompleteMe for C language?

Recently, I installed YouCompleteMe and I'm new user in it. I read installation instructions from this link: http://valloric.github.io/YouCompleteMe. Now, I can use it for python and etc, but I can't ...
2 votes
1 answer
2k views

Stop arrow keys typing letters in vim insert mode

When I hit the arrow keys in insert mode I get characters instead of navigation: I'd like to be able to use the arrow keys to navigate. Note: I recently upgraded to macOS Sierra. Maybe something ...
1 vote
1 answer
341 views

In Vim my cursor doesn't return to correct place when going into insert mode

In this line: # include <unistd.h|> ( | represents cursor) As shown in text above when I go from normal mode to insert mode the cursor doesn't return to after the > so I can't type after ...
63 votes
8 answers
60k views

tmux copy mode - select text block

I'm using tmux with vi keys, and copy/paste works fine as long as you're selecting one line of text, or if you have only one window. When I want to select a block of text (multiple lines, but not full ...
35 votes
14 answers
10k views

Vim: How do you efficiently search for text?

Whenever you want to search for text in vim you would type / and then the string you are looking for. However, when the string is a long one, and you want to do this multiple times, is there a way to ...
13 votes
3 answers
15k views

Dynamically change font size in gvim?

I'd like to be able to dynamically change the font size in gvim. Essentially, the common zoom-in/zoom-out functionality you find in a lot of software. So if I press Ctrl+=, the font size gets bigger....
24 votes
7 answers
45k views

How to jump to the beginning or end of line in vim + OS X

In terminal I can do this by pressing shift+home and shift+end, but it doesn't seem to work in vim. Home and end keys scroll terminal window only. I would like to jump in edit mode.
0 votes
1 answer
108 views

vim 9 ignoring stuff on `/usr/share/vim/vim90/`

After an upgrade from Fedora 38 to 39, vim ignores its main runtime directory at /usr/share/vim/vim90/. Even the simplest :help command fails with E149: Sorry, no help for help.txt, as its contents is ...
0 votes
1 answer
163 views

YCM on windows vim can't find python

I would like to be able to use YouCompleteMe plugin on vim (on windows). I have installed vundle, and followed the installation guide for YCM on Windows. When I run :PluginInstall I see: Traceback (...
13 votes
5 answers
7k views

Vim move cursor one character in insert mode without arrow keys

This might seem a little too overboard, but I switched to vim and I so happy about the workflow now. I try to discipline myself not to use the arrow keys, as keeping the hands on the alfa-keys all the ...
67 votes
8 answers
36k views

Move cursor to beginning of non-whitespace characters in a line in Vim

In Vim, is there a way to move the cursor to the beginning of non-whitespace characters in a line? For instance, how can I move the cursor to the "S" in the second line below? First line Second ...
5 votes
1 answer
3k views

Configure gvim swap, undo, and backup files on windows

I installed vim on windows 10 using chocolatey. When I edit a foo file in powershell, vim leaves behind .foo.un~ or .foo~ files. What are these and how do I stop vim from leaving them around?
0 votes
1 answer
287 views

How do I copy text from vim on a remote host in Terminal, to local MacOS clipboard?

I've googled the heck out of this but nothing I try solves the problem. Help? Context I'm running vim on a remote linux machine, which I ssh to in Terminal.app. I have root on the remote machine, so ...
10 votes
9 answers
6k views

Vim-like navigation n Adobe Acrobat Reader

Adobe Acrobat Reader is currently one of the good PDF readers available on the Linux platform. xpdf and Evince do their job well, but Acrobat's display seems to be better. I am used to the Vim editor ...

1
2 3 4 5
75