Live data from Hacker News

Vim 9.0

vim.org

251–260 of 272 posts

Re: Vim 9.0

#251

Earlier quoted context omitted.

I have a simple one too-- set number setlocal cm=blowfish2 set noswapfile set nobackup set nowritebackup set viminfo= set tabstop=4 set softtabstop=0 noexpandtab set shiftwidth=4 set noundofile set backspace=indent,eol,start set autoindent set smartindent set cindent autocmd BufRead,BufNewFile *.vue setfiletype html colorscheme morning map Q map q noremap x "_x let &t_ut='' if has("gui_running") :set guifont=Cascadia…

> map q you turn off macro recording? any particular reason why?

Not the person you’re replying to but I’d guess that they don’t ever record macros and just find it to be an annoyance if they accidentally press the Q key by accident.

Re: Vim 9.0

#252
post #56

Earlier quoted context omitted.

This comment thread on the previous conversation has a lot of good replies: https://news.ycombinator.com/item?id=31908731 A few highlights: * "If it ain't broke, don't fix it" * People don't like Lua (or just simply prefer VimScript) * Divergence over time means that they are not still compatible.

> People don't like Lua Who doesn't like Lua? That is right up there next to disliking kittens and puppies...

Array index starts at 1

~= instead of !=

# instead of len()

Default declaration to global

-- for comments

Dereferencing something that doesn't exist returns nil

Re: Vim 9.0

#253
post #189

Earlier quoted context omitted.

...and 34gg will save you a chord ;)

It will, but I generally prefer chords on separate hands over double keys on the same hand.

I actually agree with you and am now wondering why the heck I’ve used gg all this time.

Re: Vim 9.0

#254
post #72
post #56

Earlier quoted context omitted.

> People don't like Lua Who doesn't like Lua? That is right up there next to disliking kittens and puppies...

Arrays start at 1?

I agree that is very weird at first. But after building a toy project including about 5,000 lines of Lua, I can say I got used to it fairly quickly. Most of the time, I was accessing arrays via iterators anyway, so I had to deal with indices very rarely.

Aesthetically, it is repulsive, but when actually writing code in Lua, it was not much of a problem. I felt much stronger about "do"/"then" and "end" versus curly braces for delimiting blocks.

Re: Vim 9.0

#255
post #243

What are some of the advantages of Vim’s domain specific scripting language over, say, providing a Python API?

Vim does provide a Python API :) But most Vim addons seem to be written in Vimscript, and porting them to another language (which?) is a lot of work for little practical gain (for many/most addons).

And a Perl API :-)

Re: Vim 9.0

#256
post #227

Earlier quoted context omitted.

I would be very interested in a write up of why you prefer VSCode, if you can spare the time!

I also tried VSCode and it is sooo great. But what got me back into Vim was that VSCode sucks as an editor itself. It outsourced formatting to mostly opinionated linters^ and has only primitive two-regexp based indenting rules. Nothing even remotely comparable to vim/indent. Most linters only operate on a whole file, so there is no `5=`. This drove me mad eventually and I went back to Vim, despite the costs. I tried…

Thanks! Folks, keep these coming!

Re: Vim 9.0

#257

Earlier quoted context omitted.

I've been using vi/vim on a near daily basis for 34 years now and this is the only thing I put in ~/.vimrc: set tabstop=4 set expandtab set shiftwidth=4 " or 2 or whatever set shiftround syntax on EDIT: Just for some fun archeology, I google searched on the 3rd line, 'set shiftwidth=4 " or 2 or whatever' because I very dimly recall copying most of my standard set (minus the syntax on bit) from someone else a long lon…

No line numbers? @_@

Yeah, why enable a feature you never use?

Re: Vim 9.0

#258
post #199
post #153

Earlier quoted context omitted.

because i've always found the vi documentation a bear to navigate. i don't know what shiftwidth is even for. here's the help for it: shiftwidth([{col}]) shiftwidth() Returns the effective value of 'shiftwidth'. This is the 'shiftwidth' value unless it is zero, in which case it is the 'tabstop' value. This function was introduced with patch 7.3.694 in 2012, everybody should have it by now (however it did not allow for…

This is the help for the shiftwidth function , not the shiftwidth setting . You need to do :help 'shiftwidth'

See what I mean? WTF.

Re: Vim 9.0

#259
post #243

Earlier quoted context omitted.

Vim does provide a Python API :) But most Vim addons seem to be written in Vimscript, and porting them to another language (which?) is a lot of work for little practical gain (for many/most addons).

And a Perl API :-)

Indeed, and Ruby, and who knows what else... surprised nodejs hasn't been shoved in as well. :)

To be honest I don't know how Brad keeps up with it all. And even has enough left over to add a new bespoke scripting language with Vim 9...

Re: Vim 9.0

#260

Earlier quoted context omitted.

> map q you turn off macro recording? any particular reason why?

Not the person you’re replying to but I’d guess that they don’t ever record macros and just find it to be an annoyance if they accidentally press the Q key by accident.

You're probably right; vim macros are almost the entire reason I personally prefer vim to vi, I can't imagine not using them.
Post reply on HN