Hot answers tagged

30

vipe is a program for editing pipelines: command1 | vipe | command2 You get an editor with the complete output of command1, and when you exit, the contents are passed on to command2 via the pipe. In this case, there's no command1. So, you could do: : | vipe | pandoc -o foo.pdf Or: vipe <&- | pandoc -o foo.pdf vipe picks up on the EDITOR and ...


18

You can do this from within Vim: :w !pandoc -o file.pdf Or even write the buffer into a complex pipeline: :w !grep pattern | somecommand > file.txt And then you can exit Vim without saving: :q! However, considering your specific use case, there is probably a better solution by using vi as your command line editor. Assuming you use bash: set ...


10

Running in a pipeline Try: quickedit() ( trap 'rm ~/temp$$' exit; vim ~/temp$$ >/dev/tty; cat ~/temp$$ ) The key is that, to be able to use vim normally, vim needs stdout to be the terminal. We accomplish that here with the redirect >/dev/tty. For purposes of security, I put the temporary file in the user's home directory. For more on this, see ...


4

Make sure that vim is set as your default editor (e. g. export EDITOR=vim in your .bash_profile or .bashrc. Then, at any prompt, you can type Ctrl-X followed by Ctrl-E. This will open your current command line in your configured editor (e. g. vim). Make your edits, save and exit, and the command will be executed as though you had typed it on the command ...


3

C-b c already has a standard binding which it might be wise to leave unchanged. Choosing another character, eg C-b C you can setup a binding in your ~/.tmux.conf file as follows: bind C send-keys -t.- 'mvn install' Enter The -t.- means "the other pane". Enter stands for the key of that name, i.e. the newline at the end of the command.


2

That rule could be better written as %.o: %.cpp clang++ -Wall (...) $< This way, only the source files newer than their object files are compiled. And the highlighting will also work as expected.


2

From here you can unbind the key combination in byobu: Create a file ~/.byobu/.tmux.conf with (or add if the file exists): set-window-option -g xterm-keys on Then add the following to ~/.byobu/keybindings.tmux: unbind-key -n C-Left unbind-key -n C-Right


2

You are free to choose whichever editor that you like. nano is much easier to use than vi, but vi is also much more powerful and features an elaborate set of macro programming commands, mass operations, multiple cut&paste buffers, and more.


1

There are at least three: :set list to set list mode as already indicated. :list to print the current or a range of lines in list mode. ga to print the value of the character at the cursor.


1

Turns out that removing all ~/.zcompdump files solved it: rm -r ~/.zcompdump*


1

This is still happening in Fedora 23. My solution was to update both packages: sudo dnf update vim-common vim-minimal If I tried to update either package separately, I got the conflict. But I was able to successfully update both of them at the same time.


1

If you need to delete text with d without altering your yank register (say, you've already yanked text in it that you're not ready to paste before your delete some other text for instance), you can use the black hole register _. If you do "_dd for example, the current line will be immediately deleted and forgotten. Actually, I don't use this register very ...


1

t$v,c Or if you want to create a text object: onoremap i$ :normal! T$v,<cr> vnoremap i$ <esc>T$v,



Only top voted, non community-wiki answers of a minimum length are eligible