What is your favorite text editor?

Perhaps the following is relevant here:


Interesting to see what well known, famous programmers use.
 
VIM! (editors/vim) :D I like it very much.
Of course with custom .vimrc. I like it because it's very customizable and usable,
I use it as my only one text editor even when using X11.
vim.png
Here is my ~/.vimrc (to use alt keybindings with xterm, add XTerm*metaSendsEscape: true to your ~/.Xresources file and execute % xrdb -merge ~/.Xresources, it should work "out of the box" with other terminal emulators like urxvt, gnome-terminal, etc):
Code:
syntax on
set clipboard=autoselect        " use X PRIMARY selection
set noswapfile                  " disable swap file
set shortmess+=I                " disable uganda children
set history=1000                " set number of lines of vim command history
set laststatus=2                " always show status line
set autochdir                   " working dir is always the same as the file
set ignorecase                  " ignore case when search
set smartcase                   " ignore case only when lack uppercase
set hlsearch                    " highlight search
set incsearch                   " search while typing
set wildmenu                    " show command predictions
set ttyfast                     " faster scrolling
set mouse=a                     " enable mouse support
"set ttymouse=sgr                " available values: xterm, xterm2, netterm, dec, jsbterm, pterm
set backspace=2                 " disable vi backspace behavior
set autoindent                  " copy indent from current line when starting a new line
set ruler                       " show cursor position
set formatoptions-=cro          " disable auto comment insertion
set scrolloff=3                 " lines before and after cursor when search
set pastetoggle=<F2>            " toggle paste mode
set t_Co=256                    " force to use 256 colors
"set t_ti= t_te=                " disable screen buffer
set noeb vb t_vb=               " disable beeping
set fillchars=stlnc:-,vert:\│   " split border and inactive statusline chars
set whichwrap+=<,>,[,]          " change lines with left/right arrow
"set list                       " display TABs
set listchars=tab:+-            " characters to be used to show TABs
set title                       " enable titles
set titlestring=%F%m\ -\ VIM    " vim titles format
set statusline=%3*%y\ \ %1*%F%2*%m%3*\ \ %{&fileencoding?&fileencoding:&encoding}\ %=\ %1*%l\|%3*%L,%v\ \ %1*%P%*
colorscheme slate

" ctrl+6 to use different keymap in insert mode,
" but always use english to manipulate vim anyway
set keymap=russian-jcukenwin
set iminsert=0
set imsearch=0

" change some colors
hi User1 ctermbg=none ctermfg=white cterm=bold,underline
hi User2 ctermbg=none ctermfg=red cterm=bold
hi User3 ctermbg=none ctermfg=gray cterm=underline
hi TabLine ctermfg=gray ctermbg=black cterm=none
hi TabLineSel ctermfg=white ctermbg=black cterm=bold
hi TabLineFill ctermfg=black ctermbg=black cterm=underline
hi StatusLine ctermbg=none ctermfg=white cterm=bold
hi StatusLineNC ctermbg=none ctermfg=gray cterm=none
hi Visual ctermfg=none ctermbg=black cterm=bold,standout
hi ModeMsg ctermfg=green ctermbg=none cterm=bold
hi WildMenu ctermfg=green ctermbg=none cterm=bold,underline
hi VertSplit ctermfg=green ctermbg=none cterm=underline
hi Search ctermfg=green ctermbg=none cterm=underline,bold

" key bindings
command! W w
command! Q q
" alt+backspace
map <Esc><BS> dvb
im <Esc><BS> <C-w>
" alt+delete
nm <Esc>[3;3~ de
im <Esc>[3;3~ <C-o>de
" alt+z/shift+alt+z - undo/redo in insert mode
im <Esc>z <C-o>:undo<CR>
im <Esc>Z <C-o>:redo<CR>
" r -redo
nm r <C-r>
" p - replace selected
vm p pgvy
" space - clear search highlight
nm <silent> <Space> :nohlsearch<Bar>:echo<CR>
" ctrl+t - new tab in normal mode
nm <C-t> :tabnew<CR>
" ctrl+c - close tab in normal mode
nm <C-c> :close<CR>
" shift+q - close session in normal mode
nm <S-q> :conf qa<CR>
" shift+y - save file in normal mode
nm <S-y> :write!<CR>
" shift+u - update file in normal mode
nm <S-u> :edit!<CR>
" shift+y - yank from cursor to EOL in visual mode
vm Y <Esc>vg_y
" ctrl+shift+alt+pgup/pgdown to move tabs
map <C-S-M-PageUp> :tabmove -1<CR>
map <C-S-M-PageDown> :tabmove +1<CR>
" alt+c - yank selected to clipboard
vm <Esc>c "+y
" alt+x - cut selected to clipboard
vm <Esc>x "+x
" ctrl+v - paste from clipboard in visual/insert/command mode
vm <C-v> "+gp
map! <C-v> <C-R>+
" ctrl+n to show/hide line numbers
nm <C-n> :set invnumber<CR>
" ctrl+l show/hide TAB characters
nm <C-l> :set list!<CR>
" ctrl+f - show number of search results
nm <C-f> :%s///gn<CR>
" ctrl+alt+y - write file with sudo
nm <Esc><C-y> :silent write !sudo tee %<CR>
" ctrl+up/down - home/end
nm <C-up> 0
nm <C-down> $
im <C-up> <C-o>0
im <C-down> <C-o>$
" alt+up/down - delete all text before/after cursor
nm <M-up> v0d
nm <M-down> d$
im <M-up> <C-o>d0
im <M-down> <C-o>d$
" alt+left/right - delete left/right word
nm <M-left> dvb
nm <M-right> de
im <M-left> <C-w>
im <M-right> <C-o>de
" ctrl+alt+up/down - remove/duplicate line
nm <C-M-up> yyp
nm <C-M-down> dd
im <C-M-up> <Esc>yyp
im <C-M-down> <Esc>dd
" ctrl+alt+left/right - backward/forward word in insert  mode
im <C-M-left> <C-o>B
im <C-M-right> <C-o>W
" ctrl+w-\ - maximze current pane (ctrl+w-= to unmaximize)
nm <C-W>\ <C-W>\| <C-W>_
" F3/F4 - split vertically/horizontally
nm <F3> :vsplit<CR>
nm <F4> :split<CR>
" F5 - show word count
map <F5> :w !detex \| wc -w<CR>
" ctrl+del - delete characer from begining of line
function! DeleteFirstChar()
	let save_pos = getpos(".")
	normal! 0x
	call setpos(".", save_pos)
endfunction
nm <Esc>[3;5~ :call DeleteFirstChar()<CR>
im <Esc>[3;5~ <C-o>:call DeleteFirstChar()<CR>

" Auto paste mode when insert
if exists('$DISPLAY')
	let &t_SI .= "\<Esc>[?2004h"
	let &t_EI .= "\<Esc>[?2004l"
	inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
	function! XTermPasteBegin()
	set pastetoggle=<Esc>[201~
	set paste
	return ""
	endfunction
endif

" check file changes every 4s and update file if it was changed
set autoread | au CursorHold * checktime | call feedkeys("lh")

" restore last cursor position
if has('autocmd')
	au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
 
Last edited by a moderator:
I'm not a fan of vi, but due to this discussion decided to start it up to see if there's a delay. There was none at all. That's something I like and what I dislike about my favorite editor, which is ne. Just like ee ne has a very long delay before it fires up. Is there a list of editors that don't use a startup delay? I could be interested in changing if I see the right one.
 
You mean, editors which need 0 nanoseconds to start? I'm afraid that there are none.
Well I mean in human terms since it is me (the human) which is the end user) - so, something like 20ms. Even 50ms would be acceptable.

If you don't understand what I mean. Type vi, and then type ee after that. You'll see. :)
 
Type vi, and then type ee after that. You'll see. :)

Ah, so you actually mean "no visible delay"? Hmm, ee is even rather slow when directly compared to ed.
Other low-latency editors which I enjoyed or still enjoy using include (but are not limited to) SciTECO and Micro. Most CLI editors, except GNU Emacs and (Neo)Vim, are relatively fast though.

Honorary mention: edwood - a surprisingly good and fast implementation of the (GUI) Acme text editor.
 
Ah, so you actually mean "no visible delay"? Hmm, ee is even rather slow when directly compared to ed.
Other low-latency editors which I enjoyed or still enjoy using include (but are not limited to) SciTECO and Micro. Most CLI editors, except GNU Emacs and (Neo)Vim, are relatively fast though.

Honorary mention: edwood - a surprisingly good and fast implementation of the (GUI) Acme text editor.

I also enjoy using Micro. Another one that hasn't been mentioned is vis.
 
vi , sometime edit, interested in vim. I always use vi because it's the first editor I learned from Uni., and it's quite common in my workplace too, so just keep using it.
 
vi, mcedit, geany are equal favourites for me, depending upon what environment or editing is being performed. I have however recently installed just the free pascal IDE, without all of the compiler etc. stuff and as a text editor that's nice for being able to drag/resize windows in text mode, and even comes with a calculator. Very similar to old TurboPascal's IDE.

I run tilda terminal with F1 set to show/hide it, Quake style dropdown terminal. So the top line/row in the attached is Tilda tabs with the visible tab showing that FreePascal IDE with a couple of text files open and the calculator loaded

fp.png
 
my favourite are Emacs and mg. I use vi because it is everywhere, but i don't love it.

mg is in OpenBSD base, one of the things we may copy in FreeBSD. IMHO.
 
Back
Top