Tag Info

Hot answers tagged

34

To change the default editor at the system level: sudo update-alternatives --config editor and then follow the onscreen prompts.


32

vim can easily do that: ctrl+ws - Split windows ctrl+ww - switch between windows ctrl+wq - Quit a window ctrl+wv - Split windows vertically :sp filename will open filename in new buffer and split a window.


18

See edit-command-line in zshcontrib. bindkey -M vicmd v edit-command-line


16

There are many color schemes which are usually distributed together with vim. You can select them with the :color command. You can see the available color schemes in vim's colors folder, for example in my case: $ ls /usr/share/vim/vimNN/colors/ # where vimNN is vim version, e.g. vim74 blue.vim darkblue.vim default.vim delek.vim desert.vim elflord.vim ...


13

Cut 2 kilobytes from end of file: truncate -s-2K file


12

Emacs/Vim/Eclipse/... - Personally I am an Emacs user. If you find the control sequences tire your pinky, just Viper-Mode it up. Emacs is so well integrated into unix, making it very easy to control everything all from one place. Vim also does a good job here, but I find Elisp to be a much more powerful extension language than Vim Script. One could talk ...


12

I use pdftk mainly. But here are some others to consider: pdfsam (PDF Split and Merge): "pdfsam is an open source tool (GPL license) designed to handle pdf files" PDFJam "A small collection of shell scripts which provide a simple interface to much of the functionality of the excellent pdfpages PDF file package (by Andreas Matthias) for pdfLaTeX." (You can ...


12

You can do :100,200w filename Of course 100,200 is the range of lines you want to write.


12

This can be done using Emacs. It works in GUI and in terminal mode. You can even split multiple times. Here are some basic key combinations: C-x 2 Split the selected window into two windows, one above the other (split-window-below). C-x 3 Split the selected window into two windows, positioned side by side (split-window-right). C-Mouse-2 ...


12

From the command line, you could try paste -d '\0' file1 file2 > file3 That does exactly what you want. Visual Block mode in vim is also perfectly suited for this task. Are you sure you did it correctly? You should Go to visual block mode Select text and press y for yanking Go to the other file, on the upper left corner of the to be paste data (last ...


11

vim is a modal editor. Hit the ESC key to get into Normal (command) mode then type :q and press Enter. To quit without saving any changes, type :q! and press Enter. See also Getting out in Vim documentation.


11

With vim, you can use split or vsplit. The first one will split horizintally and the second one will split vertically. CTRLw then to navigate through split screens. You can also use tab. tabnew filename will open filename in a new tab. You can use tabnext and :tabprevious to navigate between tabs. I personnaly maps the left and right arrows to navigate ...


11

In Vim you can also just do the global replace on the start of all lines: :%s/^/;/


10

I know two programs for manipulating PDFs under Linux: PDEedit "Pdf Editor is primary created for simple editation and manipulation with objects of documents in PDF format and storing them as new version of document. Editation and manipulation with objets is by graphical and by commandline interface too. For simple use command line is using script language, ...


10

I love Geany It's a quick GUI editor that can manage small projects if necessary (it can remember list of files and a few other neat things). It supports many syntax highlighting including Shell scripting. It supports plug-ins, and I have used the VC (version control) plug-in once, but the basic features of Geany are enough for most of the work I do with ...


10

gedit can be a great editor when extended with gedit-plugins


10

It's easier to learn than Vi, faster to start than Emacs, and more powerful than Pico/Nano (e.g. it has ctags support for programming). But it's unlikely to be installed everywhere, so you should still know the basics of Vi and Emacs.


10

For editing/creating files from shell: Most linux distros come with nano which is quite friendly. Another alternative would be vi, but that's a little more complicated. For a '.bat' equivalent for sequencing commands: Depending on the shell you are using (most likely bash) you will need to write shell script, traditionally with a .sh extension (or with ...


10

For vim, you have powerful scripting available. For example, in my .vimrc, I have: " Stolen from http://www.debian-administration.org/articles/571 " Sets +x on stuff starting with the magic shebang. au BufWritePost * if getline(1) =~ "^#!" | silent !chmod a+x <afile> If you want to do it by filename only, instead of looking for the #! line, you ...


10

I've had the most luck with this: :%!xmllint --format % It's strict about your tags, though, so it will error out if your opening and closing tags don't match. It also adds an XML declaration at the top of your file, if you don't have one as well. This page recommends the following, although I can't get it to work: :set filetype=xml :filetype indent on ...


10

Install pandoc, then select any of the markup formats it supports as input. Write your manuscript in that format, then convert to .docx. I'd suggest using: Markdown if you don't need much in the way of formatting. The occasional italicized word, maybe a headline, some bullets. This site uses a variant of Markdown for posts, so you already know it. DocBook ...


9

Try using hexedit I haven't tried it on HP-UX but it should work. It allows you to move to a location in a file and truncate. I'm pretty sure that it does not read the whole file in but just seeks to the appropriate location for display. Usage is fairly simple once you have launched it the arrow keys allow you to move around. F1 gives help. Ctrl-G moves to ...


9

Menu Search->Replace (or Ctrl+h). Fill in find and replace boxes, expand Replace All, click In Session Step-by-step: Select "Replace" from Search menu. Expand "Replace All" Click "In Session"


9

Even though they type vi or call it vi it may still be vim. And at least vim can do all the "modern" features like auto-completion and syntax-highlighting, too. It can also mark/copy/paste text using the mouse if you wish. I however prefer vim and the console because I can do 100% of the work without ever taking one hand off the keyboard. Try that with a ...


9

The most general: Move cursor to first line of the group you want to write. Hit m and a sequentiall. That's "set mark named 'a'". Move cursor to last line of the group, hit 'm' and 'b'.' Change over to command mode hit: as a sequence do :'a,'b w filename then hit return. That will work in vi, nvi and vim. Another method, works in more modern vim: Put ...


9

This will delete all the files with a name ending in .swp, ~, .netrwhist, .log or .bak anywhere under your home directory. No prompt, no confirmation, no recovery, the files are gone forever. find ~ -type f \( -name '*.swp' -o -name '*~' -o -name '*.bak' -o -name '.netrwhist' \) -delete (I purposefully omit *.log because it sounds dangerous, this is not a ...


9

A normal, "modeless" editor is like Notepad on Windows: there is only one mode, where you input text. Vi, and it's successor Vim, are modal: there are two primary modes1, insert mode where you type text into the editor and it is committed to the document, and normal mode where you enter arguments via the keyboard that perform a variety of functions, ...


9

While you ask for window management system you mention features like find/replace, file management etc. which is usually not part of Window Management, but a Desktop Environment, so you should be looking for separate tools for that. For general tools I would suggest having a look at http://suckless.org, they provide nice list of "do one thing and do it well" ...


8

In case you prefer Emacs keybindings: autoload -z edit-command-line zle -N edit-command-line bindkey "^X^E" edit-command-line


8

This is not possible with a stock gedit; there's an open ubuntu brainstorm idea for adding the ability. However, there are plugins that add it, such as advanced-find. If you install that, one of the sections on the "Advanced Find/Replace" dialog is "Scope"; choose "All Opened Documents":



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