Page 1 of 1

vim.tiny

Posted: Wed Sep 04, 2019 6:38 pm
by Butters
Greetings,

I was watching a youtube video on "vim":
https://www.youtube.com/watch?v=wlR5gYd6um0

That is when I discovered that some of the commands that the host was demonstrating were not working when I ran vim.
I following the links that both "vi" and "vim" brought me to, and they both ultimately ended up at /usr/bin/vim.tiny

Also, "apt search vim" resulted in printing lines that read:
vim-tiny/oldstable,now 2:8.0.0197-4+deb9u3 amd64 [installed]
Vi IMproved - enhanced vi editor - compact version
-- as well as --
vim/oldstable 2:8.0.0197-4+deb9u3 amd64
Vi IMproved - enhanced vi editor

So my conclusion is that this distribution of MX Linux:
$ uname -a
Linux mx 4.19.0-5-amd64 #1 SMP Debian 4.19.37-2~mx17+1 (2019-05-15) x86_64 GNU/Linux
... comes with vim.tiny, as a choice made by the maintainers of the MX Linux distribution.

If my assessment is correct, then I have three questions:
1) Why was "vim.tiny" chosen over "vim"?
2) What is the difference between "vim.tiny" and "vim"?
3) If I choose to install "vim", should I first uninstall "vim.tiny"?

The folks that put this distribution together did an amazing job. So I do not want to second-guess their decisions. But I would like to have the features I saw being used in the youtube video. So before tinkering with what came with the distribution, I thought I would first ask the above questions.

Thank you.

Re: vim.tiny

Posted: Wed Sep 04, 2019 7:03 pm
by manyroads
Perhaps you should simply install the version of vim you wish to use. :happy: I use NeoVim myself and emacs (I know it's not a vim variant but emacs hurts my head less....) :needcoffee: As for uninstall... do what makes you happiest. :eek:

Re: vim.tiny

Posted: Wed Sep 04, 2019 9:48 pm
by wurthrk
My understanding is that the vim.tiny is a stripped down version of vim closer in functionality to vi than vim. It's a Debian thing, not MX.

Re: vim.tiny

Posted: Wed Sep 04, 2019 9:55 pm
by figueroa
Yes, purge vim.tiny and install the full vim. You won't be sorry.

Added: The reason it's installed instead of the full vim is because it's TINY, and most users wont' have anything to do with it anyway. But, from a power VI user going way back, vim.tiny is lame to the point of being broken. Otherwise, for one who finds vi/vim handy for minor screen editing, it works, but there is a lot it won't do.

Re: vim.tiny

Posted: Sun Jul 12, 2020 7:25 pm
by Butters
figueroa wrote: Wed Sep 04, 2019 9:55 pm Yes, purge vim.tiny and install the full vim. You won't be sorry.

Added: The reason it's installed instead of the full vim is because it's TINY, and most users wont' have anything to do with it anyway. But, from a power VI user going way back, vim.tiny is lame to the point of being broken. Otherwise, for one who finds vi/vim handy for minor screen editing, it works, but there is a lot it won't do.

I learned "vi" at an old job, where they ran NetBSD.
I know my way around "vi" (or vim). I am not an expert. But I am not bad.

Based on your comment "and most users wont have anything to do with it anyway", is there a better text editor?
nano seems to be popular. But it reminds me of Windows notepad. I do not like nano.

Is there a powerful text editor that I should consider as a vim replacement?


Thank you.

Re: vim.tiny

Posted: Sun Jul 12, 2020 9:08 pm
by fehlix
Butters wrote: Sun Jul 12, 2020 7:25 pm Is there a powerful text editor that I should consider as a vim replacement?
not sure how a powerfull text editor is defined. You could try emacs, which is powerfull.
I use fairly often mcedit part of mc, which comes preinstalled on MX Linux.

Re: vim.tiny  [Solved]

Posted: Sun Jul 12, 2020 11:06 pm
by figueroa
Butters wrote: Sun Jul 12, 2020 7:25 pmIs there a powerful text editor that I should consider as a vim replacement?

Thank you.
In my opinion, no, vi/vim rules. Nano is reminiscent of the old DOS edit program. It holds your hand through the editing of text file, as do most GUI text editors like mousepad, leafpad, featherpad. I do use a GUI text editor as a companion to vim, mainly to open text files from the desktop, and I prefer leafpad because it is competent, simple, small, fast and doesn't try to add features that might complicate it's primary purpose. Nano is vital to the ecosystem because almost anybody can use it from the commandline without instruction or a user guide. I never uninstall nano. I just never use it.

To use vim and benefit from its utility and power, one has to invest sufficient time to learn it's conventions, but once those are learned it is powerful and efficient. The user can do the editing of files from simple text files to program source code and the fingers never need to leave the keyboard to reach for a mouse. Also, vim is powerfully extended with plugins. For example, with the gnupg.vim plugin one can easily and securely edit gpg encrypted text files on the fly. Add a spelling dictionary, and vim will also do your spell checking.

vi/vim is like ex, the most rudimentary line oriented, core Unix text editor, but extended for full screen editing on a terminal versus working from a line printier. vim powerfully extends what began as vi (vim = vi improved). This is the standard place to get started: https://www.vim.org/ but there are abundant other places with tutorials and cheat sheets (highly recommend cheat sheets to help users learn commands).

I got started becoming a power user of vi through a book, "Unix Primer Plus," out of print of course, because I needed to master vi for editing hundreds of text files which were used as input for database query. But, any on-line tutorial should be enough to get one started. From editing database input files, I graduated slowly to shell scripts and even some rudimentary programming (mostly program editing). My efforts to learn the editor have been paid back many times over by the time saved using vi and vim.

gvim is an interesting time waster, but I think some people might find gvim helpful to get them started because of the comfort that many people have working within the GUI, but in practice it slows down the editing process.

I'm a big fan, but you probably couldn't tell. Of course, your mileage may vary.

See cartoon at: https://www.vim.org/about.php (Open this in a new window or tab so you don't lose your place.)

To its credit, Emacs is extraordinarly powerful but arcane. Its use is strongly advocated by its core users. I tried it, but couldn't get hooked.

Re: vim.tiny

Posted: Mon Jul 13, 2020 2:26 am
by baldyeti
Butters wrote: Sun Jul 12, 2020 7:25 pm I know my way around "vi" (or vim). I am not an expert. But I am not bad.

Based on your comment "and most users wont have anything to do with it anyway", is there a better text editor?
Not really ! vi/vim is a PITA to learn, granted, but if you are already past the initial hurdles, it is well worth persevering.

The Practical Vim book is amazing, its author also has a series of tips available on youtube.

Even plain "classic" vi is surprisingly powerful. Alan Zintz once wrote an advanced tutorial that i cannot find back in its original form but whose 4 first parts (out of 9) have been updated for vim.

When working in graphical mode, i wouldn't be as harsh as figueroa with gvim (i have a bash alias to launch it from a terminal instead of text-mode vim, works fine for me).

Geany which is included by default in MX is not bad either.

Re: vim.tiny

Posted: Mon Jul 13, 2020 10:04 am
by Adrian
I started to use vim exclusively because once you learn it it makes editing much more efficient, one trick after you learn the basics is to remove nano and this way be forced to imerse yourself in vim.
Also make sure ~/.vimrc is shared between your computers (either share it with a share file system: Dropbox, Syncthing, or put it somewhere on github) once you start to add custom stuff to it, it's useful to have your configuration propagated to all the computers you use (work, home, VM, etc)

Re: vim.tiny

Posted: Mon Jul 13, 2020 4:12 pm
by m_frank
figueroa wrote: Sun Jul 12, 2020 11:06 pm
Butters wrote: Sun Jul 12, 2020 7:25 pmIs there a powerful text editor that I should consider as a vim replacement?

Thank you.
In my opinion, no, vi/vim rules. Nano is reminiscent of the old DOS edit program. It holds your hand through the editing of text file, as do most GUI text editors like mousepad, leafpad, featherpad. I do use a GUI text editor as a companion to vim, mainly to open text files from the desktop, and I prefer leafpad because it is competent, simple, small, fast and doesn't try to add features that might complicate it's primary purpose. Nano is vital to the ecosystem because almost anybody can use it from the commandline without instruction or a user guide. I never uninstall nano. I just never use it.

To use vim and benefit from its utility and power, one has to invest sufficient time to learn it's conventions, but once those are learned it is powerful and efficient. The user can do the editing of files from simple text files to program source code and the fingers never need to leave the keyboard to reach for a mouse. ...

... My efforts to learn the editor have been paid back many times over by the time saved using vi and vim.

gvim is an interesting time waster, ... in practice it slows down the editing process.

I'm a big fan, but you probably couldn't tell. Of course, your mileage may vary.
...

To its credit, Emacs is extraordinarly powerful but arcane. Its use is strongly advocated by its core users. I tried it, but couldn't get hooked.
:yourock:
  • vi/vim rules!
  • nano annoys me when I accidentally land in it, because I forgot to tune the alternatives.
  • vim in a long terminal window, preferably 60 rows or more.
  • In order to use emacs you need to be a piano player, and I learned on the trumpet.

Re: vim.tiny

Posted: Tue Jul 14, 2020 4:50 am
by baldyeti
Adrian wrote: Mon Jul 13, 2020 10:04 amI started to use vim exclusively because once you learn it it makes editing much more efficient
I am curious Adrian, aren't you using something like qtcreator when developing the qt-based MX tools ? I'd have thought auto-completion can come real handy when working with rich class libraries.

Re: vim.tiny

Posted: Tue Jul 14, 2020 9:56 am
by Adrian
baldyeti wrote: Tue Jul 14, 2020 4:50 am
Adrian wrote: Mon Jul 13, 2020 10:04 amI started to use vim exclusively because once you learn it it makes editing much more efficient
I am curious Adrian, aren't you using something like qtcreator when developing the qt-based MX tools ? I'd have thought auto-completion can come real handy when working with rich class libraries.
qtcreator is amazing, but I use vim for editing config files and the like. BTW, qtcreator has a fakevim mode where you could use vim kind of controls to edit, I was not brave enough to enable that.

Re: vim.tiny

Posted: Wed Jul 15, 2020 3:15 am
by baldyeti
Adrian wrote: Tue Jul 14, 2020 9:56 am qtcreator has a fakevim mode where you could use vim kind of controls to edit, I was not brave enough to enable that.
Ah, good to know. So do KDE's kate and eclipse (vrapper plugin, very nice, also works with pydev or dbeaver).

Re: vim.tiny

Posted: Mon Dec 20, 2021 9:25 pm
by grgc
Hey Brothers

I also am a fan of vim. I am just learning. In the words of the Shaman, I can use visual. Amazingly, once you start to get the hang of vim, gui based editors are just annoying. I found learning vim a lot like learning to cook a meal. At first, you think that you will never be able to keep track of everything that is going on, but very quickly, you can't even remember why you were confused.

My more immediate concern is that I need to configure vim on MX. I have not yet written a .vimrc, and I would appreciate any tips that are offered.

BTW, I upgraded vim "$ sudo apt-get upgrade vim", it gave me vim HUGE.

Thank you.

Re: vim.tiny

Posted: Mon Dec 20, 2021 9:36 pm
by Adrian
My more immediate concern is that I need to configure vim on MX. I have not yet written a .vimrc, and I would appreciate any tips that are offered.
That's usually personal preference, for example if you want line numbers you can add:

Code: Select all

set number
:set nonumber to turn it off.

If you want syntax highlighting:

Code: Select all

set syntax
One cute thing I added is using \cc to comment out stuff and \xx to uncomment line or selection, it looks like this:

Code: Select all

" insert and remove comments
augroup commentshortcut
  let b:comment_leader = '# '
  autocmd FileType c,cpp,java,scala      let b:comment_leader = '// '
  autocmd FileType sh,ruby,python,perl   let b:comment_leader = '# '
  autocmd FileType conf,fstab            let b:comment_leader = '# '
  autocmd FileType tex                   let b:comment_leader = '% '
  autocmd FileType mail                  let b:comment_leader = '> '
  autocmd FileType vim                   let b:comment_leader = '" '
  noremap <silent> <Leader>cc :<C-B>silent <C-E>s/^\(\s*\)/\1<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
  noremap <silent> <Leader>xx :<C-B>silent <C-E>s/^\(\s*\)\V<C-R>=escape(b:comment_leader,'\/')<CR>/\1/e<CR>:nohlsearch<CR>
augroup END
I stole that from some other people... you can just search for vimrc to see what other people are using...

Re: vim.tiny

Posted: Mon Dec 20, 2021 11:32 pm
by grgc
Thanks Adrian

Re: vim.tiny

Posted: Mon Dec 20, 2021 11:56 pm
by figueroa
Totally stolen from others, and added to over many years, here is my .vimrc. Use freely, but at own risk. It's only 104 lines, including comments and blank lines to make it more readable.

Code: Select all

" An example for a vimrc file.
"
" Maintainer:	Bram Moolenaar <Bram@vim.org>
" Last change:	2002 Sep 19
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.vimrc
"	      for Amiga:  s:.vimrc
"  for MS-DOS and Win32:  $VIM\_vimrc
"	    for OpenVMS:  sys$login:.vimrc

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
  finish
endif

" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible

" allow backspacing over everything in insert mode
set backspace=indent,eol,start

if has("vms")
  set nobackup		" do not keep a backup file, use versions instead
else
  set backup		" keep a backup file
endif
set history=50		" keep 50 lines of command line history
set ruler		" show the cursor position all the time
set showcmd		" display incomplete commands
set incsearch		" do incremental searching

" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")

" Don't use Ex mode, use Q for formatting
map Q gq

" This is an alternative that also works in block mode, but the deleted
" text is lost and it only works for putting the current register.
"vnoremap p "_dp

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

highlight Comment ctermfg=DarkGray
hi LineNR ctermfg=DarkGray
" hi CursorLineNR ctermfg=Red
" hi String ctermfg=Gray
" hi PreProc ctermfg=Brown

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Enable file type detection.
  " Use the default filetype settings, so that mail gets 'tw' set to 72,
  " 'cindent' is on in C files, etc.
  " Also load indent files, to automatically do language-dependent indenting.
  filetype plugin indent off

  " Put these in an autocmd group, so that we can delete them easily.
  augroup vimrcEx
  au!

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid or when inside an event handler
  " (happens when dropping a file on gvim).
  autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \   exe "normal g`\"" |
    \ endif

  augroup END

else

  set noautoindent		" always set autoindenting on

endif " has("autocmd")

"set wrap
"set linebreak
"set nolist
"set wrapmargin=80
"set number

set spellfile=~/.vim/spellfile.add

set spelllang=en_us

map <F2> :set nospell
map <F3> :set spell

set t_BE= 			 " correct bracketed mode paste

set cm=blowfish2

Re: vim.tiny

Posted: Tue Dec 21, 2021 4:47 pm
by grgc
Thank you figueroa. Very helpful.

Re: vim.tiny

Posted: Tue Dec 21, 2021 4:47 pm
by grgc
Thank you figueroa. Very helpful.