Tag Info

Hot answers tagged

4

In vim, you should be able to use the command :%s/\t[^\t]*// (substitute TAB followed by zero or more occurrences of any character except TAB with nothing). If your file has only two columns you could use a slightly simpler :%s/\t.* or :%s/\t.*$which replace the first TAB and any following characters up to the end of the line.


4

vim [your file] If this isn't working for you, make sure you have it installed with: sudo apt-get install vim If you're already IN vim do :edit [your file]


3

If you are serious about the couple vim + latex, my preferred option is to use the couple latexxmk + LaTeXBox. latexmk is independent of the editor, really --- it's a script that watches the files needed to compile a latex document and re-run the compilation when needed. Configuration is a bit complex, but it is a really useful tool. For example, my setup ...


3

The accepted answer is much more elegant than this (I upvoted it!) but if you do not remember it you can use vim visual block mode directly. Open vim and go (normal mode) to the first corner of the column, like this: Type CTRL-V and you can move the cursor to select the column, this is midway: To go at the end, press G: the block seems broken ...


2

Not sure if this is what you are looking for. Below a script with with you can change name, digit and operator of functions by their index (0 = first function). In the head of the script, you set a list of tuples with the desired settings, like: [(index, ("NewName"), ("digit"), ("operator")), (index, ("NewName"), ("digit"), ("operator"))] You can pick ...


2

I would use cut for this cut -f1,3- file.txt > newfile.txt mv newfile.txt file.txt You can use this as a filter within vim, too (this will replace all the lines in the file; you could also use (for example) 2,9 instead of % to process lines 2-9, or select the lines you want with V): :%!cut -f1,3- -f1,3- means 'print field one, followed by field ...


2

The problem is not that it does not apply to nano, it's that it does not apply to the shell: Just set the VISUAL environment variable: export VISUAL=vim Add this too ~/.bashrc to make it permanent. As you seem to use vim in general, set both VISUAL and EDITOR: export VISUAL="vim" export EDITOR="$VISUAL" or more POSIX-correct VISUAL="vim" ; export ...


2

You have two options. For system-wide availability of the color theme, use sudo to copy it there: sudo cp colortheme.vim /usr/share/vim/vim74/colors If that isn't necessary, use your own vim configuration folder: mkdir -p ~/.vim/colors cp colortheme.vim ~/.vim/colors


2

Try something like: command C !xelatex % in your ~/.vimrc. Then you can do: :C in vim to compile the file.


2

Type sudo update-alternatives --config editor You will get a text like below. There are 4 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status ------------------------------------------------------------ * 0 /bin/nano 40 auto mode 1 /bin/ed ...


1

If you want just to make your user use by default a different editor, add export EDITOR=vim; in your .profile (or wherever you keep your startup environment if using a shell different from bash). Log out, log in, check that the variable is set: [romano:~] % env | grep EDI EDITOR=vim and now all the programs that call an editor (and are well written) ...


1

You can also use tabs and split views: :tabe /path/to/file Effect: :vs /path/to/file (or :hs for a horizontal split) Effect: Use :tabn, :tabp to navigate between tabs, and CtrlW with the arrow keys to navigate between splits.


1

As of Ubuntu 14.10 (utopic), a powerline package is available in the universe repository. To install it, just run this command in your terminal : sudo apt-get install powerline Alternatively, you should be able to install it by using the Ubuntu Software Center.


1

Emacs has a facility that you might find useful. It is called the Keyboard Macro Counter. For example, if you enter the following sequence while defining a macro C-x C-k C-i C-x C-k C-i C-u C-x C-k C-i C-x C-k C-i the text ‘0112’ is inserted in the buffer, and for the first and second execution of the macro ‘3445’ and ‘6778’ are inserted. Read more on ...


1

Resolved. It turned out to be a duplicate. I referred this: How do I make vim the default graphical text editor? I had some problems creating a .desktop file, but this link is useful : Creating .desktop files to use on the "Open with other application" tab


1

Two possibilities in vim: search and replace in the visual selection: choose a visual selection (v from normal mode), and then use: :'<,'>s/1/3/g you will notice that if you press ":" from visual mode the :'<,'> will appear automatically so you have just to type the search and replace command; (my preferred one) edit in vim, and when ...



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