Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> is there a a way to close such that the previous file that was originally opened to return?

If I understand the question correctly then the answer is ":bd" after ":w"riting the file. If you just want to switch between buffers (switch between the two files) then use ":b#". You can also list open buffers with ":ls"

Someone recently told me of :tabedit, though, and that is lookin' way nicer to me. But I haven't gotten used to it yet or know how to make it work with gf or other handy things.

As for split screen, those are hotkeys I have yet to learn. If someone has an answer to that question, please reply here so the parent commenter and I both see it :)



"Split screen" as in make a new window? Sure - `:vs` ("vertical split"), or `:vs filename.txt`. Or there's the "Windows" section on https://thevaluable.dev/vim-intermediate/ .


great got both answered perfectly!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: