An intriguing reason for forking #Vim 🧐:
“A Eulogy For Vim”, Drew DeVault (https://drewdevault.com/blog/Forking-vim/).
An intriguing reason for forking #Vim 🧐:
“A Eulogy For Vim”, Drew DeVault (https://drewdevault.com/blog/Forking-vim/).
С Vim удобно программировать (часть III)
Это окончание статьи о REPL на Vim. Содержит пару простых примеров применения разработки автора - работа на Ruby с Sinatra и работа с Git.
С Vim удобно программировать (часть I)
Статья о том, как своими руками в Vim сделать универсальный (т.е. работающий для разных языков программирования) REPL (от англ. read-eval-print loop — цикл “чтение — вычисление — вывод”), да и просто сделать этот редактор более удобным.
terminal buffer를 통한 pwd sync
https://hackers.pub/@widehyo/2025/terminal-buffer%EB%A5%BC-%ED%86%B5%ED%95%9C-pwd-sync
이 글은 Vim의 `:terminal` 커맨드를 활용하여 터미널 버퍼를 효율적으로 사용하는 방법에 대한 여정을 담고 있습니다. `:terminal`로 열리는 터미널 버퍼는 `Terminal-Job`과 `Terminal-Normal` 모드를 지원하며, `tmap`을 통해 제어할 수 있습니다. 특히 `terminal-api`를 이용하면 터미널 모드에서 Vimscript를 호출하여 Vim의 기능을 확장할 수 있습니다. 글에서는 터미널 버퍼의 현재 디렉터리를 Vim의 현재 디렉터리와 동기화하는 방법, 그리고 이를 자동화하는 과정을 상세히 설명합니다. `.bashrc` 설정과 Vimscript 함수를 결합하여 터미널에서 파일 시스템을 탐색할 때마다 Vim의 현재 디렉터리도 함께 변경되도록 구성합니다. 또한, 내장 셸(`:sh`)과의 전환, REPL 환경에서의 사용, 일회성 명령 실행 등 다양한 사용 사례를 고려하여 터미널 사용 모드를 전환하는 기능까지 구현합니다. 이 포스팅은 Vim의 터미널 기능을 깊이 있게 활용하고자 하는 사용자에게 유용한 팁과 실질적인 설정 방법을 제공하며, Vim과 터미널을 더욱 긴밀하게 통합하여 생산성을 높이는 데 기여합니다.
vim popup으로 floating window를 사용해보자
Vim 8 이상에서 제공하는 `popup` 기능을 활용하여 플로팅 윈도우를 만드는 방법을 소개합니다. 특히 `popup_menu()`를 사용하여 리스트를 팝업 메뉴로 표시하고, `callback` 함수로 팝업 종료 동작을 변경하거나 `filter`를 통해 키 입력을 제어하는 방법을 설명합니다. Less 바인딩, visual mode, yank 기능을 포함한 `filter` 예시를 통해 `echomsg` 디버깅 내용을 쉽게 복사할 수 있도록 합니다. 또한, Ex 명령어나 시스템 명령의 결과를 플로팅 윈도우에서 편리하게 확인하는 함수를 제시하고, 자주 사용하는 명령에 대한 키 매핑 설정 방법을 안내합니다. Neovim에서는 플로팅 윈도우를 더 편리하게 사용할 수 있으며, Lua 스크립트를 통해 동일한 기능을 구현하는 방법을 소개합니다. 이를 통해 Vim과 Neovim에서 플로팅 윈도우를 활용하여 작업 효율성을 높일 수 있습니다.
Getting NeoVIM to not read anything VIM finds seems impossible, but it is easy to make the vimscript a noop with `if has('nvim') | finish | endif`. The similar Lua versions don't get read by VIM, so that direction isn't a problem.
I implemented Decasify in a single repo as a #vimscript plugin that loads in #vim and a #lua plugin that leads in #neovim, the former depending on the CLI and the latter depending on the Lua Rock. Also there is now an override so NeoVIM can go the other way too.
I think any large interesting program you might write could well have an embedded language within it, in which the user can write stuff that is just as good, and just as deep as built-in functionality. You want this. It’s a thing that makes programs compelling.
In #Vim, that embedded language is #VimScript. In #emacs, that’s #elisp (which in fact, I think the whole thing is written in). In a #smalltalk environment, you control the entire environment with Smalltalk, just as elisp applies to Emacs. For many, many things, that language is #lua ( #NeoVim, many games, #pandoc, #redis, this list goes on).
I used to think there were really two reasonable mainstream languages you could use here: #Python or #javascript. Between those two, for a long time I felt that JavaScript was the winner. I think that has changed as Python has gotten faster, more powerful, and better known. But also, I think the answer might actually not be either of these two. It might be Lua. Lua is simpler and faster than either JavaScript or Python. It’s more embeddable. It’s designed specifically for this purpose. It’s in much wider use as an embedded scripting language. I don’t want Lua to be the answer. I like Python better. But I think Lua actually is the right answer.
Ok, I admit that writing a syntax file in Vimscript is a pain.
#Vim #NeoVim I found what was replacing all my argument lists with underscores: argtextobj.vim. This is one of my favorite plugins. It hasn’t been touched in 15 years, though. Probably something changed in the editor itself that broke it. I could abandon it; I could fix it; or I could rewrite it. I asked my friend what language it should be rewritten in. He said #vim9script of course! I disagreed. That would only work in Vim. #lua would only work in NeoVim. Maybe #vimscript from just before 9. Maybe #Python. Maybe #rustlang. All three of those would run in both. I kinda don’t want to use VimScript, but that’s technically the correct choice.
Of course it would be waaay easier if it used the #lsp. Otherwise you’re parsing patterns and brackets and strings. Not sure such a solution works in plain old Vim.
What does the #fediverse say?