2
votes
0answers
29 views

Bash inside Vim not working properly

In MacVim I'm using Conque to run bash commands inside Vim. I have a problem with the text navigation while using Conque. If I'm at the end of a line of text and press down Alt← I skip a word to the ...
1
vote
2answers
56 views

Configure bash and/or vim to execute source ~/.bashrc everytime I finish editing it

I would like to execute source ~/.bashrc every time I finish editing a file with vim (i.e. after :wq vim command). How should I configure vim or bash to work that way?
1
vote
0answers
73 views

Can't open vim in zsh? [closed]

I recently decided to try out zsh, but for some reason I cannot open Vim in a zsh shell. Currently, my default shell is bash. If I open up a terminal window, then run zsh to enter a zsh shell, I have ...
1
vote
1answer
48 views

vim flag to append a line and save

I'm trying to mock an editor as part of writing feature tests for a CLI that I'm working on. I need to mock an editor which is opened and quit directly without saving, as well as an editor which ...
2
votes
4answers
971 views

less command and syntax highlighting

I need to use the less command with the syntax highlighting of the vim command for python, C, bash and other languages. How do I apply syntax highlighting colors according to vim colors for less ...
3
votes
2answers
97 views

How to switch to editing command in text editor [duplicate]

When typing a complicated command that started on the command line in Bash, how do I switch to editing it with ViM?
1
vote
0answers
106 views

Modify .inputrc to fix Mac Terminal bug with vi mode

I currently have a bug in my Mac's Terminal (I actually use iTerm2 but it's still there), where once I press left arrow after typing, I can't go past the last character. Is there a way I can modify ...
2
votes
1answer
250 views

bash script - supervisor program

I have to write a shell-script that have to do the following tasks: -in every 5 seconds it saves:     -how many users are using joe and/or vi;     -if ...
2
votes
3answers
151 views

Open multiple files in Vim with a filelist

I have a file 'filelist' that contains the following lines: text1.txt text2.txt text3.txt I am looking for a command line invocation that opens the 3 files in vim. I tried the following: $ cat ...
1
vote
2answers
561 views

How do I set bash aliases and variables from within vim?

In cmdline mode, the following examples do not work for me. !alias lol='echo lol' !lol='echo lol'
2
votes
3answers
96 views

Ctrl+W in vi[m] to erase to whitespace

I want to mimic the functionality of bash readline in vim. Is there an easy way to do that? Currently in vim Ctrl+W "cuts" from cursor back to special char or whitespace. ie. In bash Ctrl+W "cuts" ...
3
votes
3answers
4k views

vim how to configure backspace and delete key's both as normal

How to configure following keys in vim? Backspace key to delete a character backwards. Delete key to delete a character forwards. After reading some posts, I got to know that only one of those can ...
2
votes
4answers
262 views

Remove large chunks from json using vim

I have a huge file (1/2 million lines) of json. I need to delete a set of entries that contain a certain string. { "bla1": { "Part1": "Plop1", "Part2": "Plop2", "Part3": ...
19
votes
9answers
2k views

Bash commands inside vi

Is it possible to type a bash command inside vi and get the stdout? I find it often tedious to close and reopen vi just because I want to look something up in the shell.
3
votes
2answers
180 views

place the aliased version of an existing command in /usr/bin/

I use Vim a lot, and I know how I can start vim in insert mode. So I have an alias named vii in my .bash_aliases file. On other hand I use Git a lot too, and I have this line in my .gitconfig: ...
4
votes
1answer
687 views

How to skip vim message “Press Enter…” after running bash commands

After running bash commands(e.g !mv file1 file2) vim outputs result of that command and prints this message: Press Enter or type command to continue Is there a way to skip this message and return to ...
5
votes
3answers
968 views

Run a vim macro from inside a bash script

In a bash script I want to edit a file. Is there a way to write a macro in vim, save it and then call it in bash script?
1
vote
2answers
1k views

Script to create files in a template

I just wrote a function in my ~/.bashrc that will let me create a folder for a new website with one command. The function looks like this: function newsite() { mkcd "$*" # mkdir and cd into it ...
18
votes
6answers
3k views

Advantages of using set -o vi

I have seen many developers using this command to set the option to vi. I never understood the real use of this? When using bash commands, what help does switching to vi provide?
7
votes
1answer
430 views

Note-taking and outlining using Vi: On startup, highlight tags and display tags in a preview window [duplicate]

I am using vi as a note-taking and outlining tool and therefore I thought that this stackexchange site would be appropriate to ask this question. I am constructing the "tags" file by myself. What I ...
7
votes
2answers
264 views

How do I get just the user-manual for Vim

To get the vim user-manual I am doing vi test and then, once the file is opened, I do :help user-manual This opens up a split window, which makes reading manual inconvenient to read. How do I ...
3
votes
2answers
982 views

How to map one vim command to execute bash commands based on OS?

In short, can single bash commands in the terminal contain conditionals? If so, how? I have in my vimrc (shared across systems) the following command to open my current LaTeX document in .pdf form: ...
7
votes
7answers
1k views

Open a file given by the result of a command in vim

I find myself doing the following almost every day Run a find (find -name somefile.txt) Open the result in vim The problem is I have to copy and paste the result of the find into the vim command. ...
15
votes
1answer
2k views

Is it possible to have vim key bindings in terminal?

I'm getting used to vim bindings (like pressing w to go to word, dw to delete a word, and such) and it's modes (insert, normal, visual), and, out of curiosity would like to know: is there some kind of ...