Skip to main content

Questions tagged [unix]

Filter by
Sorted by
Tagged with
0 votes
1 answer
3k views

How to specify different tab widths for different languages? [duplicate]

I am using Neovim (v.0.8.0) along with nvim-lspconfig and neoclide/coc. It is working pretty well. The only problem being tab widths. If I am writing in say, Java or C, I use 4-space wide tabs, ...
ABCDEF's user avatar
  • 3
0 votes
1 answer
315 views

How to set fileformat based on file type?

In a project I need to set fileformat=dos for all *.html files. Is it possible to do with autocmd? My fileformats=unix,dos by default, since I'm on Linux. I've tried the simplest way: autocmd BufRead *...
d.k's user avatar
  • 724
0 votes
1 answer
43 views

!v command UNIX - relation to Vi or vim [closed]

Whenever I type !v command in the UNIX terminal, in a particular directory, my vim editor opens with the file "hello.txt" which I have never created in that same directory or anywhere. What ...
Mathpdegeek497's user avatar
0 votes
0 answers
86 views

calling vim with mpiexec says "Warning: Output is not to a terminal / Warning: Input is not from a terminal"

My question is a bit technical. For specific reason, I need to call vim after mpiexec. Example : mpiexec -n 1 vim mytext.txt But this gives the following warning message: Vim: Warning: Output is not ...
Kiven Jecquas's user avatar
1 vote
1 answer
2k views

vim ctrl+c doesn't copy/paste with ctrl+c or ctrl+v

I was trying to map ctrl+c to copy, ctrl+v to paste in vim, but it's not working properly.I've tried https://stackoverflow.com/questions/61177658/mapping-select-all-copy-paste-in-vim and https://...
victor 0x3E7's user avatar
3 votes
1 answer
2k views

How do I use vim within a Unix pipe-line?

I can use vim / ex to grep a file using the following invocation: ex -c'g/foo/p' -cq -s afile.txt I'd really like to use a similar command to grep some text from stdin. I thought the following command ...
andypea's user avatar
  • 133
1 vote
0 answers
12 views

How to access subprocess exit code [duplicate]

I want to write function that passes current line and file to external program and saves its output into register, e.g: function Foo() let l:current_line = line(".") let l:current_file = expand("%...
KAction's user avatar
  • 121
1 vote
1 answer
50 views

Cross-platform way to execute command with clean environment?

A plugin I use executes: silent execute '%!cmd' which fails because of a particular environment variable I have set that deliberately modifies the behaviour of cmd. I can fix it with: silent ...
OJFord's user avatar
  • 435
1 vote
1 answer
116 views

How do I move cursor around on unix shell using VIM commands? [closed]

I'm a vim user and forgot to grab my csh/vim settings before leaving my prev company. Basically, when tooling around my unix shell, I used vim commands (eg go back and forth using VIM quick-keys, ...
user15563's user avatar
5 votes
2 answers
323 views

Vim custom key mapping not working in superuser mode

I have a custom key mapping jj to escape, it works for normal file edit but when I open the file as a superuser the key mapping doesn't work anymore, why? I use Antergos os.
kapil's user avatar
  • 428
-2 votes
1 answer
206 views

What are the basics of vi editor? [duplicate]

I want to know the basics of vi editor because I am new to linux and currently I am using ubuntu 16.04.
Akshay Mohite's user avatar
8 votes
1 answer
4k views

How to preview the result of markdown file edited in vim?

I use vim to edit latex, but latex is bit too heavy for taking notes casually on daily basis, so I decided to use markdown instead. So, I want to configure vim so that I could view markdown ...
Tom's user avatar
  • 379
2 votes
1 answer
60 views

Is there a platform independent way to use "${ENVVAR}more_text" in vim?

I just discovered that I am able to use ${ENVVAR}more_text in a vim installation on Unix, but not if installed on Windows. In Unix, I did in a shell: export ABC=/tmp/ echo foo>${ABC}foo gvim ...
René Nyffenegger's user avatar
7 votes
1 answer
1k views

How can I automate filetype detection when using sudoedit?

sudoedit/sudo -e is often used for safely editing files as root. The way it works: sudoedit copies the named files to temporary files Then it opens the temporary files using the commands specified by ...
muru's user avatar
  • 25.1k
8 votes
4 answers
3k views

Put a process started with ! in the background

If I do this from the shell: $ sleep 100 I can make it go to the background by doing: ^Z $ bg And then continue using my shell. You can get the same effect by adding a & to the end of the ...
Martin Tournoij's user avatar
10 votes
2 answers
5k views

How to write whole buffer to standard output from the command line?

I would like to write whole buffer into standard output (/dev/stdout) instead of the file and the following command works as expected while editing the file: :w >> /dev/stdout Hint: Press ...
kenorb's user avatar
  • 18.7k
7 votes
1 answer
328 views

Can visual select mode be integrated with the Unix selection clipboard?

Is it possible to configure vim (obviously with :set mouse=a) and/or gvim such that the visual selection modes automatically integrate with X's selection buffer? I am aware of how to setup the copy ...
Caleb's user avatar
  • 2,255
27 votes
4 answers
12k views

How to edit content from the standard input?

I would like to edit content in vim which was dynamically generated from the command-line without having the file yet. In example: $ echo This is example. | vim /dev/stdin $ cat /etc/hosts | vim /dev/...
kenorb's user avatar
  • 18.7k
42 votes
5 answers
5k views

Terminal borked after invoking Vim with xargs

I've sometimes tried invoking Vim using xargs, like this: find . -name '*.java' | xargs vim … which kind of works: As Vim launches, I see the following warning flash briefly: Vim: Warning: Input ...
200_success's user avatar
  • 9,629
14 votes
4 answers
12k views

How do I edit crontab files with Vim (I get the error: 'temp file must be edited in place')?

How do I edit crontab files in FreeBSD? $ crontab -e # ... I do my thing in vim & :wq "crontab.9ZcXiFaawt" 6L, 203C written crontab: temp file must be edited in place Exit 1 Using EDITOR=nvi ...
Martin Tournoij's user avatar