texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.79k stars 344 forks source link

vim editing #155

Open davidwbulger opened 6 years ago

davidwbulger commented 6 years ago

I would love to be able to use vim editing within TeXstudio. If that is already available, I have not found the right setting. But, just now, I tried to search the issue tracker for other vim requests, and accidentally searched the code as well, and saw this encouraging remark in qeditor.cpp: "QEditor can be given an InputBinding which can change the way it handle user inputs which enables such things as implementing emacs-like or Vi-like editing (almost) effortlessly." So is this in development?

Environment

sunderme commented 6 years ago

no plan for it, no work done If someone wants to provide code, it may be welcome.

francescoboc commented 4 years ago

+1 !! I am sometimes thinking to switch to vim for tex editing (which now I use mainly for C/python coding), but then I think of the fantastic features of texstudio (e.g. pdf preview, code completion, \ref suggestions etc.) and all the time that I would need to set them up properly in vim... So, having vim keybindings and modes in texstudio would be agame changer!

ZirconCode commented 4 years ago

Duplicate of #53. If this is still open in 4 months I will do this myself.

davidwbulger commented 4 years ago

Wow, that would be awesome. I've ended up going very low-tech, the last couple of years, editing directly in vim, with this in my vimrc:

" HOMEBAKED LaTeX: PRESS F5 TO GET EITHER ERROR MESSAGES OR A PDF PREVIEW IN CHROME:
function! Pdflatexcurrentfile()
  if bufname("%") =~ ".tex$"
    update
    let texout=system("pdflatex -interaction=nonstopmode " . bufname("%"))
    if texout =~ "\n! "
      vsplit __pdflatex_error_messages__
      normal! 1GdG
      setlocal buftype=nofile
      call append(0, split(texout, '\v\n'))
    else
      let texout=system("pdflatex -interaction=nonstopmode " . bufname("%"))
      silent !start "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --incognito "%:p:r:s,$,.pdf,"
    endif
  else
    echo "Not a LaTeX file."
  endif
endfunction

nnoremap <F5> :call Pdflatexcurrentfile()<CR>

But vim bindings could totally tempt me back to texstudio.

raffaem commented 2 years ago

still no plans?

sunderme commented 2 years ago

nope

bva99 commented 1 year ago

Does anyone have any suggestions on how to go about adding this feature in TeXstudio? Like, initial pointers.

How to add a Vim option in Settings. How to add Command and Insert modes to TeXstudio. I believe the initial steps are the toughest. Navigation and basic shortcuts first. Interaction with other TeXstudio features second. Visual mode can be added later.

I'd really like to contribute, but I'm completely lost :/

Something like VSCode's or PyCharm's Vim extensions (maybe even Neovim) would be great.

jle1n0 commented 1 year ago

I definetly support this effort :+1: I wonder if the editor is based on something existing that may already have some support for vim protocol? Something in Qt?

Edit: quick look, seems to be based on something called QCodeEdit. May be that the effort has been abandoned and is alive in TexStudio only?

Ahmed-Zahran-AZ commented 7 months ago

nothing yet? :(

Ahmed-Zahran-AZ commented 7 months ago

I have found this . Maybe it can be used with the texstudio editor widget.

sunderme commented 7 months ago

if someone wants vim commands in txs, they have to implement it themselves. It is lots of work and no benefit for non-users.