Stack Exchange Network

Stack Exchange network consists of 175 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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [vim]

Vim is an open-source text editor with a steep learning curve that leads to high efficiency in many tasks related to text edition. If you wish to start with vim, try to run “vimtutor”, which will teach you basic commands.

2
votes
1answer
980 views

strftime returning time for wrong timezone

I'm trying to get "dts" to echo the current local time in vim (cygwin under Windows 7) byt the output is GMT+1 instead of the localtime (GMT-7). My abbreviation works fine on other machines, but I can'...
3
votes
1answer
2k views

Vim SCP parameter with private public key pair

Currently, I am trying to edit a file on a remote server using Vim's built-in netrw plugin. I can SSH fine into my Amazon EC2 server using a command like this: ssh -i <keyfile> bitname@<ec2-...
0
votes
1answer
78 views

How to instal vim using salt stack?

I have salt-stack maser and minion servers which running on centos7. I want to install vim package in minion server. For that I have created srv directory and vim.sls file under etc. My vim.sls file ...
9
votes
4answers
15k views

How to enable color in Vim over SSH?

I have two remote servers: Server 1: Linux 2.6.18-238.12.1.el5PAE i686 / VIM - Vi IMproved - version 7.0.237 Server 2: Linux 2.6.18-338.19.1.el5.lve0.8.36 x86_64 / VIM - Vi IMproved version 7.0.237 ...
2
votes
1answer
2k views

Creating a global Vim configuration, including separate configuration files for plugins?

I use Arch Linux (ARM, but irrelevant) on a server machine, and I want to create a global configuration for Vim, based on my current personal configuration. I have already moved my ~/.vimrc to /etc/...
33
votes
14answers
21k views

How to bring .vimrc around when I SSH?

My work tends to involves using SSH to connect to various machines, and then using vim to edit files on those machines. The problem is that I have to constantly copy my .vimrc file around. It's very ...
17
votes
5answers
4k views

Windows Powershell Vim Keybindings

Is there a way to get vim keybindings in powershell as you would in bash or zsh with a command like set -o vi
2
votes
3answers
337 views

SSH access denied when 'authorized_keys' file is created with Vim

I created an ec2 instance with an Ubuntu 16.04 AMI. I created a sudo user for this AMI with: sudo adduser myuser sudo usermod -aG sudo myuser Then I attempted to give the user ssh access with an rsa ...
0
votes
2answers
430 views

Edit a remote file in Vim with sudo when ssh root login is disabled

I am trying to determine a way to edit remote files in Vim that require sudo, but still use my local vim config and plugins. Currently I can open vim and :e scp://me@server//some/root/file and make ...
2
votes
1answer
34 views

FreeNAS prevents writing to VIMs .swp file

Our developers recently updated to the latest version of vim and sense then when they edit files from the network share hosted on a FreeNAS server, they eventually cannot write the file, as the .swp ...
45
votes
5answers
32k views

How to make a global ~/.vimrc?

Right now, I make everyone do ~/.vimrc and put their settings there. How can I make a global, default .vimrc for new users?
0
votes
1answer
956 views

Can't open file /usr/share/vim/vim73/syntax/syntax.vim

Whenever I use vim command, I get this error: Error detected while processing /Users/boss/.vimrc: line 6: E484: Can't open file /usr/share/vim/vim73/syntax/syntax.vim Press ENTER or type command ...
14
votes
2answers
8k views

How to set vim filetype when editing nginx config files

When I open vim for a file like /etc/nginx/sites-available/default, syntax highlighting works fine. But then if I create my own file /etc/nginx/sites-available/myapp, vim does not highlight its syntax....
0
votes
2answers
673 views

Installing blowfish2 for use in VIM on CentOS 7

I'm moving from a Debian-based distro to CentOS 7. I have files encrypted with blowfish that I edit transparently in VIM with this setting in ~/.vimrc: :set cryptmethod=blowfish2 This is the error ...
3
votes
1answer
161 views

Vim hangs on one specific file?

My putty session keeps on hanging when I'm in the middle of editing a file in vim. This has happened three times this morning. Hopefully it's nothing, just a glitch in the matrix somewhere, but I ...
1
vote
1answer
59 views

cannot access .log file in Ubuntu

pertinent parts of python script that creates/writes log files def kill(fullpath,typ): #add check to assure .recycle!!!! if any(check for check in requiredChecks if check in fullpath) and typ=...
13
votes
4answers
3k views

Save file after forgetting to open as root / sudo vi [duplicate]

Possible Duplicate: vim re-edit as root I could have sworn I saw this question asked. But after looking though every search result for "vi" I'm stumped/lazy. I've opened a file, made an edit and ...
0
votes
1answer
2k views

How to disable ctrl-v in Vim?

In /etc/vimrc, how do I disable the ctrl-v feature. I.e, disable visual block.
0
votes
1answer
134 views

Is it possible to remove the SSH delay in order to work with VIM through it?

I'm trying to write programs using VIM on a remote server. The server is necessary because I'm in a system without VIM (iOS). When I connect through SSH, there is a visible delay of 200~600ms, which ...
19
votes
12answers
2k views

What language for starting on Linux? [closed]

I am about to begin a 4-year information security degree at Purdue. The degree does not call for any programming courses. So the only time I will be able to take one is the occasional elective. So ...
28
votes
4answers
7k views

vim re-edit as root

I often open a file in vim, make some changes and when it's time to save the file is read-only.. (owned by another user). I'm looking for tips on how I could re-open the file as root and keep my ...
0
votes
3answers
397 views

Unable to highlight all comments in Vim

Problem: Vim does not highlight all my comments apparently because of folds alt text http://files.getdropbox.com/u/175564/vim-color-problem.png Note the line 84 where the comment is not highlighted. ...
1
vote
2answers
328 views

Remote editing with diff / patch?

I do most of my work in vim. I much prefer to edit files using vim locally rather than sshing into a server and running vim there, for many reasons, one of the most important being UI responsiveness ...
0
votes
4answers
6k views

Vim how to change the cursor from char block to pre pipe/line [closed]

Not sure what the terminology is for it but on Vim the 'cursor' is always like an insert/replace cursor instead of the blinking line cursor I'm used to in other gui editors. Is there any way to change ...
11
votes
4answers
7k views

Vim - Trigger action\script on save\write?

This might be better for super user, but I figure as a tool of the trade it might be a better topic for here. I find often when editing in vim that I exit out, run some script that I am testing, and ...
1
vote
0answers
102 views

CentOS-Like configuration of Vim on Ubuntu

Whenever I use a CentOS System, there's always a pleasant configuration of vim which mainly does the following: Remembering position of closed files Colour mode (!!!) Bash has colours There's lots ...
1
vote
2answers
3k views

Why can't I change the mode of /proc/sys/kernel/pty/max even when I am root?

Since pty is limited, I want to modify the content of /proc/sys/kernel/pty/max. The original value in max is 4096, and now I want to modify it to 10000. [root@home pty]# pwd /proc/sys/kernel/pty [...
1
vote
1answer
634 views

How to prevent users from renaming files while providing write permissions on Linux [closed]

For some special purpose, I want to prevent non-root users of the Linux Server from changing/renaming the filenames. However, they can modify and write to the contents of the file. How to do this from ...
2
votes
2answers
1k views

Puppet and Vim fighting over Ruby version

I have installed puppet 3.0.1 from the .dmg from puppetlabs. If I remove ruby 1.9.3, puppet works, but other things like my vim install (dependant plugins) do not. According to http://docs.puppetlabs....
0
votes
1answer
386 views

Nerdtree, Rake 'require' cannot load file error

Gents, When trying to install NERDTree, I get the following error, suggestions? Running from an AWS Amazon linux ami: drwxrwxr-x 2 ec2-user ec2-user 4096 Apr 2 10:33 autoload drwxrwxr-x 2 ec2-...
5
votes
3answers
5k views

Change location _viminfo file on Windows

I use gvim 7.2 script dev and other admin work on a Windows XP laptop and it has picked my network share as the location of the _viminfo. This is problematic because it takes a long time for vim to ...
11
votes
2answers
5k views

How to tell Vim to extend the background color to the whole screen?

I have an issue with the Vim color schemes: The background color does not fill the whole screen. For example, in the "blue" color scheme the whole screen should turn blue. Instead, the blue background ...
1
vote
1answer
125 views

Vim Doesn't Source All Commands In auto-command Group

I have a vim auto-command group that looks like this: augroup filetypedetect_wiki au! au! FileType vimwiki iabbrev cfo %% TODO {{{1<esc>hhhhhhhhveh au! FileType vimwiki iabbrev cfc %...
0
votes
2answers
141 views

Using ex in init scripts

I'm using ex to modify configuration files from an /etc/init.d/CONFIG script. I'm using debian squeeze (updated yesterday) My problem is: It's impossible to start ex / vi in init scripts with the vi ...
6
votes
7answers
2k views

Split vim window

How do I have vim and a console in the same window? For example, I am splitting up the vim window into multiple windows (vertically or horizontally). What I want is to have the code window on the left ...
3
votes
1answer
1k views

Can vim execute buffer without addons?

If editing some script in vim, a file with .py or .sh extension, is it any build-in vim command that allows to run such file? I know it's a lot of IDE-like addons for VIM that allows to execute files ...
5
votes
2answers
971 views

When using vim with screen the keys ctrl + right and ctrl + left don't work

In the last days i became very addicted of using the combination terminator (in full screen) + screen + vim. But i'm having problems with the ctrl + right and ctrl + left key mappings, they are ...
3
votes
1answer
2k views

disabling specific byobu/screen keybindings that conflict with vim keybindings

ctrl + a under byobu has either emacs mode or screen mode. However, I need keybindings like ctrl + a for vim's "increment value" method. How would I prevent byobu/screen from blocking certain keyboard ...
4
votes
3answers
2k views

How to I use Vim's increment (Control-a) when in a screen session?

Is there a way to re-map Control-a in screen to Alt-a or something else, so I can use Control-A in Vim normally (increments the number under the cursor)?
0
votes
2answers
1k views

256 Color Issue when using GNU Screen inside GNU Screen

When I have a SSH session in GNU Screen to another machine on which I'm also using GNU Screen, 256 colors don't seem to work. The $TERM is still set correctly. However, if I run Vim, the theme does ...
0
votes
1answer
460 views

How do I detect and possibly change the encryption algorithm used by Vim's “encrypt” mode? [closed]

I'd like to start using "vim -X" to store encrypted text files. This is a nice introduction on how to do it: http://www.techrepublic.com/blog/security/vim-offers-strong-file-encryption-with-blowfish/...
2
votes
2answers
6k views

How do I enable characters like [Æ, Ø, Å] in PuTTY/Debian?

I'm using VIM through PuTTY to work on my development server, but it gets rather difficult when I have to work on files containing characters like those mentioned in the title. Not only does it make ...
3
votes
2answers
576 views

Setting a default vim filetype for syntax highlighting

How do I tell vim to automatically use a particular filetype (usually for syntax highlighting) when none is detected?
-1
votes
2answers
88 views

I need a popup help file for Vim [closed]

Is there some kind of plugin or mode that can be used to display some help for commands? I am increasingly finding nano inadequate. I want to be come a hardcore Vim and Emacs user.
1
vote
1answer
473 views

Telnet hangs with vim [closed]

I'm starting to use telnet for remote access and control of others windows pc. The problem that I'm facing is that when i start the VIM program the telnet session hangs and it doesn't respond to any ...
17
votes
2answers
7k views

How do I keep 10 lines visible when scrolling up to EOF with CRTL-F?

I am used to using vi, not vim. What I find annoying in vim is that when you are scrolling with CTRL-F and reach EOF, vim scrolls down to the very last line and put this line on the top of your screen,...
1
vote
2answers
1k views

Split large sql file by location of string OR start sql from last fail

I have a 15GB sql file which is a backup of a database. The problem I have is that half way through it, it failed. Luckily, I know which table to pick up from. Is there a way I can split this SQL ...
-1
votes
2answers
111 views

vim create one's own syntax configuration file [closed]

I'm trying to create my own syntax configuration file for vim. I have then created a ~/.vim/filetype.vim file with the following content: augroup filetypedetect autocmd BufNewFile,BufRead *....
2
votes
2answers
228 views

Scrolling? ~ Vim ex mode

Feel free to point me to the appropriate documentation for this. When in ex mode ( Q ) and entering numerous commands, the file scrolls up to where you can't see what you're working on. Are there ...
1
vote
3answers
115 views

Change Vim configurable based on filetype

Is there a way where I can set vim to configure itself based on the filetype? So for example, text files have the equivalent of :set spell :syntax off Where a C source file has :syntax on :...