Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [vim]

vim (Vi IMproved) is a text editor supporting different editing modes.

0
votes
0answers
27 views

Close the file in vim without closing the file explorer

I am browsing the files in vim file explorer by entering vim dirname. Then I am opening the file, saving and closing it by entering :wq. Now the file explorer window disappears. How to prevent this ...
0
votes
0answers
19 views

How can I get neovim to load my init.vim file when in sudo mode?

I'm having an issue with neovim on a Raspberry Pi coding with Python. I have installed it by sudo apt-get install neovim, and it works using just the nvim in commandline. For some reason I can create ...
1
vote
1answer
22 views

How to get clipboard as input file name to Vim on bash?

I install xclip to access system clipboard, my setting and some operations as below: ➜ ~ cat .zshrc | grep xclip alias c="xclip -selection c" alias v="xclip -selection c -o" ➜ ~ which dict | c ➜ ~ ...
2
votes
0answers
136 views

How to edit a 100GB file in Linux?

I have a file that has several times my RAM capacity and I need to edit it, search for some expressions, etc. I've tried Vim (with LargeFiles plugin and CTRL + C trick), joe, shed all without luck. ...
1
vote
2answers
61 views

Why updates overwrites Vim that built from source?

I build Vim from source, and install it with checkinstall. Soon after Software&Updates warned there is an update for Vim. But after the installation, Vim path is altered and another build take its ...
0
votes
0answers
34 views

Output in terminal after quitting program

I'm using Kubuntu with i3, and I've recently migrated from Manjaro because things. My terminal emulator is urxvt but, when I use programs such as vim, less or nano in the terminal remains the part of ...
1
vote
3answers
55 views

Nailing down vim regex substitution

I started using Vimwiki to document weekly progress on my projects last year. As the year rolled on, the format of my list of links to weekly wikis changed a bit. At the end of the year I decided to ...
2
votes
0answers
39 views

Vim editor universal config for copy/paste on multiplatform environment does it exists? [closed]

I spend a lot of time to get comfortable working with Vim, and I am there right now, except one thing. Also it look like Vim has advantages in many cases working on embedded programming or kernel ...
1
vote
0answers
32 views

Need to edit a single file in a tar.gz using Python [closed]

Vim provides the ability to edit a single file in a tar.gz without unarchiving. ( i.e. vim some_archive.tar.gz ) How could I script the same type of operation using Python?
-1
votes
2answers
60 views

How to make Readline in vi mode to read .vimrc?

When using Readline's vi mode in Bash, I can use command v from normal mode, to open the current command line in Vim for editing. However, in this case, Vim does not read my ~/.vimrc file, so none of ...
0
votes
0answers
55 views

how to setup vim plugin YouCompleteMe for python?

the autocomplete works for class. as shown in he screenshot but it does not for class.subclass. also it does not work for : var = class() so var. will not trigger the autocomplete.
0
votes
0answers
29 views

Neovim key mapping on Linux Mint

I recently started using Linux Mint (19, Cinnamon). I'm editing ~/.config/nvim/init.vim but some settings do not work. I want to move between windows I split. Here is what I have. " Work noremap <...
0
votes
1answer
25 views

Can't get plugin for Vim to work with Vundle. What am I doing wrong?

I am trying to install this plugin here for my Vim on my Centos 7 laptop. The instructions I followed to install the plugin manage Vundle are from the Github Vundle page here and then proceeded to ...
-1
votes
3answers
53 views

How can I replace ~60 print entries in 5 different files using vim or sed?

Fabfile (directory) containing Python files: print "DEBUG fab_helper DRYRUN: True"+var print "DEBUG fab_helper DRYRUN: True" #print "DEBUG cfn_stackname: "+cfn_stackname To: LOGGER.DEBUG("DEBUG ...
7
votes
4answers
604 views

Viewing man pages in vim

I wrote a function in bash to see manpages in vim viman () { man "$@" | vim -R +":set ft=man" - ; } This works fine, the only problem occurs if I pass a manpage to it which doesn't exist. It prints ...
-1
votes
1answer
17 views

vim: Execute command for FileGroup

I try to open NERDtree whenever I open a Golang file: au FileType go exe 'NERDTree' However, when I open a Go file from another directory it still displays the current directory. I can pass the ...
2
votes
1answer
50 views

How to prevent Vim from translating C-j into C-m when started by the zle widget `edit-command-line`?

I have the following code in my ~/.zshrc: autoload -Uz edit-command-line zle -N edit-command-line bindkey '^X^E' edit-command-line It binds the edit-command-line zle widget to the keysequence C-x C-...
1
vote
1answer
30 views

Question about Vi/Vim buffer

i just started using Vi/Vim editor and while i m checking the list of active buffers for the buffer i m using i get this line: 1 %a + "buffername" line 16 What does %a + ...
0
votes
3answers
40 views

How to use Unicode hex escape in :s/// replacement string in Vim?

I want to use a hexadecimal Unicode escape in the replacement string of a substitution command, i.e., with the example character U+20AC: :s#something#\x{20AC}#g The above example doesn't work, ...
0
votes
1answer
46 views

Change vim cursor in Terminator

I am using Terminator in Ubuntu as well as vim. My question is whether there is a possibility to use an underscore cursor in insert mode and a block cursor in normal mode. I read on http://vim....
1
vote
1answer
70 views

Should I learn to memorize these keys for Vim for moving - h,l,k,j? [closed]

For VIM in command mode, the keys h,l,k, and j are used to move the cursor but I see no point in memorizing these at the moment because when going into insert mode, I use the arrow keys to move the ...
0
votes
1answer
39 views

Unix Function func_name ### {{{ purpose of #and {

Function func_name ### {{{1 { Function defined Return statement } ### }}}1 I’m not sure on the purpose of these curly brackets and ###
3
votes
2answers
127 views

Why my simple script vim don't work for tab character?

This is my simple script of vim #!/usr/bin/vim %norm f^ID %norm $i, %!awk '{ for (i=1;i<=NF;i++ ) printf $i " " }' The first line delete all after the tab(^I) the second add a "," after every ...
1
vote
1answer
41 views

man pages no longer rendering - lots of “permission denied” errors related to pager / vimpager

For reasons I can't determine, within the last two days the "man" command stopped working on my linux server (Ubuntu 18.04). When attempting to run man <anything> I end up at a blank instance ...
0
votes
1answer
39 views

Grepping lines which have range of number

I have few lines in my text file as below. I want to grep all the lines which have patterns like :100, :101 and :102 up to :199 . How to get those lines instead of searching like this. :100\|:101\|:...
2
votes
1answer
56 views

Unable to copy from VIM to clipboard using "+y command

I am unable to copy strings from vim paste them somewhere else, for example in the terminal, using "+y. I run Ubuntu on my laptop, the vim version is vim-gtk, it has xterm_clipboard and clipboard ...
0
votes
1answer
99 views

Why is vim frozen?

I have two different machines (home and work) running Ubuntu 18.04. Last night vim froze at home. I was in insert mode and typing and went to save (esc :w) and nothing happened. The status bar still ...
1
vote
0answers
38 views

How to prevent `$MANSECT` from being altered when using Vim as a manpager?

Inside the file ~/.zshenv I export this value for the MANSECT environment variable (the value is taken from /etc/manpath.config): export MANSECT=1:n:l:8:3:2:3posix:3pm:3perl:5:4:9:6:7 This variable ...
1
vote
2answers
58 views

Syntax highlighting in Vim turned on for user, but off for root

I noticed that when I open a file like ~/.bashrc in Vim as root, the syntax highlighting (SH) when editing a bash script as normal user (blue for comments, orange for keywords, red for numbers, etc.) ...
6
votes
2answers
654 views

Delete but not cut a line in Vim

This is not duplicate of delete line in vi, it's asking different question. I'd like to delete a line without cutting it (placing it in clipboard). I'd like to copy part of line, delete a line and ...
2
votes
1answer
80 views

Change the shell of vim

I change my shell to zsh now.But when I call shell in vim by :! xxx will call the bash.So, how can I call zsh in vim ?
1
vote
2answers
256 views

Terminal colors look wrong when using tmux with termite

The terminal i'm using is termite, and it is very good, but i'm having a problem with vim colorschemes and some colors in the terminal itself too when using tmux. It happens as follows: As you can ...
0
votes
2answers
115 views

printf and backspace

I thought of playing around a bit with find -fprintf. In case you don't know what -fprintf does, it is the same as -printf but writing to a file you specify its name. Now, when I run a command like ...
1
vote
1answer
26 views

Save/restore cursor location upon fold close/open

When I open a fold, either one created manually or one created automatically based off syntax, my cursor remains on the top line of the fold. Instead, I'd like it to jump to the position it was at ...
2
votes
1answer
68 views

How to start Vim in insert mode at end of first line when committing Git changes?

What would be the best way to set Vim up to always put the cursor in insert mode at the end of the first line (to account for commit message templates) when running git commit? This would basically do ...
0
votes
2answers
45 views

Vi editor: deleting a portion of a line

Consider the following line of python code: columns = ["registered","casual","counts", "workingday", "month", "dteday"] I often need to remove one or more strings from such a list. What is the most ...
-1
votes
1answer
34 views

Find the pattern in 1 line and replacing in another line

I have some local soft link paths of files as below. ./tech/finegrain/DUALDFTIO/synopsys/DUALDFTIO.TSMC7N.db ./tech/finegrain/ESD18V/synopsys/ESD18V.TSMC7N.db I got original paths till directories ...
0
votes
0answers
34 views

How do I stop Ubuntu 18.04 from opening gvim maximized?

When I open gvim, it always starts maximized. However, in my ~/.vim/gvimrc file, I have: set lines=58 set columns=239 Calling :version: system vimrc file: "$VIM/vimrc" user vimrc file: "$...
0
votes
2answers
80 views

Is there something like cat with history?

It's about a program that works iteratively - gets input from stdin and pass the results over the stdout. There is a set a know text that need to be passed to this program and I've put them in a file ...
0
votes
1answer
31 views

st terminal: Can't distinguish ctermfg=7 and ctermfg=15

I've noticed that with default config.h of st, when I try to invoke vim inside st, there's no difference between white color ctermfg=7 and ctermfg=15. Here I expect 7 will have less-white than 15 but ...
1
vote
1answer
63 views

st-terminal / vim - Ultisnips: How to enable Ctrl+Enter as Enter in insert mode of vim? [closed]

I get a strange behavior of vim but it can be related to st-terminal that I cannot do an Enter or Ctrl+Enter to break the current line into new line in insert mode, as in the example below: I have a ...
0
votes
1answer
236 views

Update Vim in RHEL to version 7.4.2009

I am trying to write a Go server on a RHEL 7 system, but the Vim plugin, vim-go, requires version 7.4.2009, where the system only has 7.4.1099. I have tried yum install vim and it already has the ...
4
votes
2answers
141 views

How to copy and paste data between remote vps'vim and local vim?

Connect remote vps with ssh. ssh user@vps_ip Edit a file in remote vps with vim and write a line some text In normal mode ,press yy ,how to paste some text to my local'vim? And vice versa. 1.GUI ...
0
votes
2answers
63 views

How to search in vim ignoring all whitespace (and making it a function)

How can I search a string in vim and thereby ignoring any whitespace (or particularly line breaks) between any characters? And probably thereby making a function that can search ignoring all ...
0
votes
4answers
38 views

substitutions in vi editor

I have file called foo.txt. This file contains values: abc.tar.gz abc.1.1.tar.gz bca-1.2.tar.gz I would like to get an output like this abc abc.tar.gz abc.1.1 abc.1.1.tar.gz bca-1.2 bca-1.2.tar.gz ...
0
votes
1answer
38 views

Is it possible to have two config files of vim? [duplicate]

I would like to use vim in two scenarios: To write a code. To write prose. Customizing the vim's config file (i.e. .vimrc) is hard work. When I edit (.vimrc) for prose, some specs of what I can ...
2
votes
0answers
53 views

How to close brackets in vim

What is the line to add to my ~/.vimrc to do the following ?: 1) If I open a { on line X, it automatically creates a } on line X+2 with correct indentation: 1 something foo(bar){ 2 3 } 2) Cursor ...
-1
votes
1answer
61 views

.swp file size increasing automatically, why? [duplicate]

I want to ask reasons for swp file for instance generated by vim increasing its size automatically. What could possibly be the reasons / factors of size being increased?
0
votes
3answers
174 views

Why doesn't root alias vi to vim if it's standard for other users?

On centos (and I believe many other distros) vi is aliased to vim for all users by default. However, for whatever reason vi is not aliased to vim for the root user, something that always annoys me ...
0
votes
1answer
64 views

vim running in tmux permanently freezes when I accidentally type C-x s [duplicate]

I use emacs a lot, and type C-x s to save there. When I am in vim running inside tmux on a remote machine, if I accidentally type C-x s, the vim instance completely freezes up, and the only way out is ...