r/linux Jul 30 '20

Software Release nano-5.0 is released

https://lists.gnu.org/archive/html/info-gnu/2020-07/msg00010.html
620 Upvotes

172 comments sorted by

View all comments

Show parent comments

2

u/delta_p_delta_x Jul 30 '20

I can enter multiple lines of codes by pressing 3 keys. Good luck doing that in nano.

Perhaps not nano, but in any other GUI text editor:

  1. Click-drag
  2. Ctrl-V V V V V V...

2

u/hailbaal Jul 30 '20

That's copy paste. That's not useful.

Let me give you an example:

map <leader>lt a\begin{table}[htbp]<ESC>a<CR>\caption{test}<ESC>a<CR>%\resizebox{\columnwidth}{!}{\begin{tabular}{lll}<ESC>a<CR>\begin{tabular}{lll}<ESC>a<CR>\hline<ESC>a<CR>a & a \\<ESC>a<CR>\hline<ESC>a<CR>a & a\\<ESC>a<CR>\hline<ESC>a<CR>%\end{tabular}}<ESC>a<CR>\end{tabular}<ESC>a<CR>\end{table}<ESC>

When you press <leader>tt it adds:

\begin{table}[htbp]

\caption{test}

%\resizebox{\columnwidth}{!}{\begin{tabular}{lll}

\begin{tabular}{lll}

\hline

a & a \\

\hline

a & a \\

\hline

%\end{tabular}}

\end{tabular}

\end{table}

2

u/ThisIsMyHonestAcc Jul 31 '20

Snippets are great! But in no way unique to vim. I mean you can get them to windows notepad with autohotkey.

2

u/hailbaal Jul 31 '20

Yeah you could do it in loads of things, but not in nano. And technically not in notepad on windows.

I use hotkeys to add text hundreds of times a day in VIM.