Ultimately, it doesn't matter, whichever you click with first is fine.
VIM seems more commonly used (IMO) and has a shit ton of plug ins to let you configure it as you wish. but I use VIM so I might be biased (though I don't use a lot of plug ins, or really use it well).
EMACS is a fine operating system with a text editor built in. If there isn't a plug in for it, you can likely write a LISP program to do what you want. I keep wanting to use EMACS as an excuse to pick up LISP, but I just can't bring myself to do it.
But yeah, for where you are now, just pick one that seems to work best for you and run with it. By the time the difference between the two really matters, you'll be able to sort out why you want one or the other. Or just run EMACS with the VIM plugin.... or VIM with the EMACS plugin... either way.
Stack Overflow gets this question a lot
https://www.vim.org/scripts/script.php?script_id=300
https://stackoverflow.com/questions/1430164/differences-between-Emacs-and-vim
check out the tagbar plugin which has extensions for various statusbar plugins
also https://www.vim.org/scripts/script.php?script_id=610
https://www.reddit.com/r/vim/comments/d8z7r/a_way_to_display_the_current_function_in_the/
No, but I usually use a Linux VM on my corporate-provided laptop as my development environment. I'm a software developer.
If I'm lazy or whatever and don't feel like booting up the VM, then I just use Notepad++ or Crimson Editor combined with a couple command prompts open for debugging/execution since there's not really a tmux equivalent that I like. Sometimes I even pretend I'm a PrOfEsSiOnAl and use Wing IDE. Most of the time it's vim even on Windows, though.
There is tetris.vim which is written in pure vimscript.
There is also vim-golf. That is not exactly a game in vim, but it is pretty close.
Hey all! This is a theme I made last weekend because I couldn't find a colorful, blackboard-like theme with my ideal syntax colors on a black background. Others have seemed to like it so far as well, so I figured I'd share it here. Hope you enjoy it.
Honestly, I gave up on "smart" plugin systems and just use pathogen now: https://www.vim.org/scripts/script.php?script_id=2332
aka, "do what you need to do to get something in ~/.vim/bundle" -- usually git clone
.
You could probably take inspiration from https://www.vim.org/scripts/script.php?script_id=302 for interpreting escape sequences.
Or you could write a couple of syntax patterns like this.
(edit: added a quick example)
How about a slightly improved version that doesn't use a temporary file and makes the buffer a scratch buffer?
function! Tree() 35vnew setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile call setline(1, split(system('tree -Fa -I ".git"'), "\n")) endfunction
(edit: added an alternative version)
Sure. Vim is a keyboard-based text editor included with most OS’es if my memory serves me right. [Vim Website] To open vim from the terminal or bash window or whatever your OS calls it, type “vi [filename.extension]”. That will open up that file in Vim, or create it. Navigating vim is confusing at the start so I’d suggest looking for a YouTube tutorial on how to use it.
It makes me very uncomfortable that it's not J and K or H and L.
Lots of apps map J and K to scroll up/down and H and L to scroll left/right. It's a very old standard arising from the best text editor.
Why not use vim itself to read the code, after generating a tagfile with ctags
?
:help tags
Find main() and go from there. :)
---
You might also want to generate a calltree graph using cscout. There's a vim plugin that works with cscout's output. There are also some tools that use graphviz
to draw a nice diagram of the calltree.
Or fire up a debugger and step through the code (stepping over some of the details you don't want to explore just yet.)
Similar plugin is vim-mark. I use black and white colorscheme with minimal syntax highlighting but find it indispensable for understanding unfamiliar parts of code, following flow of variables through different sections and highlighting logs.
> TL;DR - Is there some magical IDE I haven't heard of where I could lower the need to constantly swap between IDE's depending on the language? Or is this something that just comes with working with different languages?
There is, but you won't like the answer: it is GNU Emacs. Averaging over all languages, Emacs will have the best support. However, Emacs is based on ancient UI principles that will be alien to most users, who are accustomed to interfaces derived from IBM CUA in the mid 80s. Further, Emacs's IDE-like features take serious effort to set up, and are not nearly as powerful or polished as those you will find in mainstream IDEs for popular languages like IntelliJ, Visual Studio, or Eclipse. However, Emacs will give you a tolerable experience for even quite obscure languages, which these will not.
The closest competitor to Emacs for a "universal IDE" is Vim, but it has the exact same issues (and perhaps an even more inscrutable UI to the uninitiated).
While I practically live in Emacs myself, I recommend you stick with the IDEs you know how to use, unless you are willing to invest a lot of time.
well.. building might be possible since vim still uses c90. the maintainers of vim put a lot of effort to make it backwards compatible
alternatively check this out
>that uses c (just c not # or ++ )
That's good, as this sub accepts only C (C++ and C# are off-topic)
>im sick of just coding in text editors and want an actual program to show me my errors before i try compiling it.
What text editor are you using? Any decent editor should have a plugin for that (e.g. ALE for Vim). I actually prefer this over IDE.
I have been using this for a while, if I understand correctly it's very similar: https://www.vim.org/scripts/script.php?script_id=1599
From the documentation:
Line mode <C-h><C-h> Highlight current line <C-h><C-a> Advance color for next line highlight <C-h><C-r> Clear last line highlight
I second Goyo.vim for focused writing sessions. If you use a markup language such as Pandoc Markdown and want your piece outlined in a second window, allowing you to manipulate sections or phantom sections, I suggest you have a look at VOom (Vim Outliner of Markups).
You need a compiler to compile your code. Visual Studio is somewhat standard for Windows-based developers, or you can use gcc. Either way, you need to install something. This walkthrough gives you everything you need.
gcc
https://gcc.gnu.org/install/binaries.html
To use vim, download and install vim.
You should raise your question on the vim_dev mailing list. In the meantime as almost always there are plugins to help you out. I personally use ReplaceWithRegister by Ingo Karkat. You must also install as described repeat.vim and visualrepeat.vim. It adds a new normal mode operator gr
and works as follows:
aaaaaaaaa bbbb cccccccccccccccc
Yank first line with yy
. Move to second line and press grr
. Then move the last line and press .
. I really like this way. gr
has become one of the few non-standard normal mode operators I use already for a long time and miss very fast on vanilla vims.
To add to this, you could download the vim plugin c-support (used to be called c-vim) and do the compilation within vim. They have hotkeys and etc that should make your life easier :)
Most lists evolve so slowly that they seem stale.
IMHO the best way to follow recent plugins is the list of scripts on vim.org. Unfortunately very little in terms of curation, the list view is aniquated and often a hassle to install lacking git repos.
I was also experimenting with a github search - however the results are so flooded with vimrcs that they are useless.
Really glad to hear that. That's exactly what I shooted for when creating the theme. Retro-looking with an editor/terminal feel to it. I was a heavy user of Solarized before discovering Gruvbox which was actually designed for Vim, a terminal editor.
Thanks for the link! Is this the right website to download vim? https://www.vim.org/download.php
It's hard to follow the terms and I'd need to read really carefully. Does it take long time to get used to it?
I guess at that point it becomes semantics, however their own documentation calls it a text editor, and not an IDE.
> Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X. Source: https://www.vim.org/
I don’t agree that someone without vim experience can use it as an IDE, whereas someone without VSCode experience can use it as a truly integrated environment. That being said, I don’t have much vim experience, and I’m sure with a lot of time and expertise it can be a very customized IDE.
Yes, definitely. It generally doesn't matter what program you're using to write code, as you'll be compiling/running the code with a different tool anyway. The only notable difference is that not every shortcut or hotkey will work in every editor, and some editors include more quality-of-life features than others. But they're all just text editors in the end and serve the same purpose.
That said, it actually seems to be possible to install vim on Windows as well. There's a download link for a Windows version on the official website.
> But apparently no one had, so I had to write it myself!
Here we go:
https://www.vim.org/scripts/script.php?script_id=2223
https://github.com/tomtom/tinykeymap_vim
and with https://github.com/kana/vim-submode you can implement this as well.
There's the Vimium extension that adds in a lot of the Vim keybindings. It also adds in the ability to press F on the keyboard and have all the links on a page get a 1-2 character "code" next to them that you can type in to visit the link
Haha true. I mean, technically you can: I just found a plugin that turns vim into a web browser. I would never want to do this though, so you're right, lol!
>Hitting :w<enter> ends up being a lot of key strokes when done over and over again.
I was a the same point and also wanted to reduce my key strokes.
I ended up using the AutoSave plugin created by Alexey Chernenkov and I'm very happy with it.
https://www.vim.org/scripts/script.php?script_id=4521
https://github.com/907th/vim-auto-save
You can easily toogle the plugin on and off and adjust the events on which AutoSave will perform a save. By default, it will save on every change in normal mode and every time you leave insert mode. You can also define an autosave hook in the options.
Actually, I have been thinking about building a proper package registry for a while, but there are a bunch of difficulties associated to the task that, in my opinion, should be addressed first:
https://packages.vim.org
.I've once stumbled upon a function that does just this, it was trendy some time ago. apologize for not being able to provide the source. needless to say i take no credit for this, for i've only slightly modified it.
inoremap <Tab> <C-R>=SuperTab()<CR> fu! SuperTab() let l:part = strpart(getline('.'),col('.')-2,1) if (l:part=~'^\W\?$') return "<Tab>" else if pumvisible() return "<C-n>" else return "<C-x><C-o>" endif endif endfunction
There's also a plugin by the same name
That's vim, possibly even with stock configuration and a custom terminal color scheme. Nothing about what that person is doing has anything to do with their text editor though - you can do all of this in any editor you like.
Never mind. It doesn’t work for c++ either. I am following the instructions from point 1. and I am getting an E117: Unknown function: CSyntaxAfter, it also says Error defected while processing FileType Autocommands for “java”: The instructions are at https://www.vim.org/scripts/script.php?script_id=3265 I have followed the point 2. instructions as well but it did not help.
I use Jetbrains IDEs myself, but I can take advantage of their education program and my work is not commercial.
I don't personally do C++, but I use their IDEs for Java and Python and frankly, I love them for that. Their stuff seems consistent enough with each other that I would expect CLion to be more of the same.
In the past when I had to touch C++, vim was all I needed and similarly, if I don't actually need IDE features, an editor like Atom does the job if I'm not in the mood to use vim.
if you're a programmer, stick to qwerty - you'll find yourself typing on other people's machines a LOT, whether it's a work machine, or just typing something for a colleague to show them some code
Better idea for an easier life for your fingers is to use the Vim editor -> https://www.vim.org/
It's generally seen as having the most 'efficient' keybindings out there, and is designed around putting the shortcuts all on the home row, so you don't stretch your fingers too much reaching the ctrl, shift, alt keys.
I imagine you'll get much more benefit from this, especially because programmers spend much more time navigating code and moving text around (copy / paste or other editor shortcuts) than actually typing out long paragraphs, which I believe is what dvorak & the like was designed for
https://www.vim.org/images/vim.txt
________ ++ ________ /VVVVVVVV++++ /VVVVVVVV\ \VVVVVVVV/++++++\VVVVVVVV/ |VVVVVV|++++++++/VVVVV/' |VVVVVV|++++++/VVVVV/' +|VVVVVV|++++/VVVVV/'+ +++|VVVVVV|++/VVVVV/'+++++ +++++|VVVVVV|/VVV_++++++++++ +++|VVVVVVVVVV/##/ ++++ +|VVVVVVVVV_ +/##,##,\ |VVVVVVV//##/+/#/+/#/'/#/ |VVVVV/'+/#/+/#/+/#/ /#/ |VVV/'++/#/+/#/ /#/ /#/ 'V/' /##//##//##//###/ ++
Is this supposed to be an object lesson for us? Or did you forget that this is not r/churchianity, I mean r/christianity? I wonder how this same conversation would go over with you if God/Jesus were changed to Santa and hell to the naughty list:
My 12-year-old nephew came out as a rational adult. So I delivered a fired-up sermon about Santa, the North Pole, and THE NAUGHTY LIST.
I spent an hour talking about how terrible The Naughty List is. I preached about COAL in his STOCKING. I described the pain of THE NAUGHTY LIST in vivid detail. I told him that if he doesn’t turn to Santa he will end up on THE NAUGHTY LIST! He laughed the whole time saying “There is no Naughty List”. Then he went away saying he doesn’t want to hear any more about The Naughty List, and asked me to stop bringing up the subject.
He said that The Naughty List is just a scare tactic and it almost certainly does not exist. He said there is no proof of Santa or of The Naughty List, and that Christmas is just a system of control and making money built on fear. BULLSHIT!!! THE NAUGHTY LIST IS VERY REAL AND NOT BELIEVING IN IT DODS NOT MAKE IT ANY SHORTER!!
I presented solid proof of both Santa and TheNorthPole, to no effect.
YOU FEEL SORROW BEYOND ANYTHING YOU CAN IMAGINE ON THE NAUGHTY LIST!!! THERE IS NOT A TEAR OF JOY ON THE NAUGHTY LIST!!! EVERYONE WHO GOES ON THE NAUGHTY LIST WILL HAVE TO ENDURE ETERNITY OF UNIMAGINABLE REGRET!!!
I want him to believe in SANTA and accept His gifts so HE DOESN’T GO ON THE NAUGHTY LIST!!!
BECAUSE WITHOUT SANTA THERE IS ONLY THE NAUGHTY LIST!!!!!!
I want to properly SCARE him of THE NAUGHTY LIST and get him to get on his knees and yell “SANTA! I DON’T WANT TO GO ON THE NAUGHTY LIST! SAVE ME!”!!!
Brought to you by the awesome power of Vim.
> Which editor did you use to write in Python?
I develop on Linux or MacOS, so I use vi/vim. That's available for Windows, but if you can't install anything I have used notepad on Windows. IDLE is just too painful.
> So you don't use an IDE at all, or does this only apply to Python?
I've never used an IDE for anything. Even when I was programming C heavily I just used vi/make and the Unix/Linux tools (grep, find, shell, etc). Of course, I've mostly developed on Unix/Linux where there is quite an extensive array of tools. Windows is a desert, so the first thing to do there is install a Unix/Linux environment.
The current version of plasticboy/vim-markdown is indeed very slow on large files. I've basically stuck with the 2009-05-18 version from https://www.vim.org/scripts/script.php?script_id=1242.
I evaluated moving to the built-in markdown highlighter, but it doesn't highlight code blocks by default and if you try to enable it you run into problems like https://github.com/tpope/vim-markdown/issues/81
As others have said, the way you paste it depends on how you yanked the text. Line-wise pastes line-wise, character-wise pastes character-wise and block-wise pastes block-wise. If you want to be more flexible, there is a plugin that allows you to choose how to paste, regardless of how the text was yanked.
Got it basically working:
echo ":e test.sh|w|q" | nvim -es
which starts nvim without showing it and executes the commands piped into it (seems to be really powerful). To write the highlighted file (after you have included the function into you init.vim/.vimrc)echo "source .vimrc | :e
<code>file.sh</code> | call AnsiHighlight('/tmp/ccat.tmp') | q" | nvim -es -R
Still need to integrate this into fzf but should work (maybe after some tweaks)
glad i saw this along with /u/a__b's initial comment. so thank you both.
i'm trying out vim, well.. neovim, "seriously" for the first time after years of knowing only ":wq!" while using nano (and pico ;)) as my CLI editor-of-choice...
i printed this out on paper -- https://neovim.io/doc/user/quickref.html#quickref -- thinking it would serve me well but it's pretty rough to follow, at least initially.
i never actually thought to check out vim's website for documentation and i can already tell it's going to be useful just with a quick glance... don't want to de-rail the thread too much but would you happen to have a few quick tips/tricks for those of us who are new or wanting to check out vim for the first time?
Vim. The learning curve can be a little steep, but once you know how to really use it, it's fast and functional. It's based on the UNIX editor vi (pronounced vee eye) and that's where I started using it. Now I run vi or Vim on all of my systems - UNIX, Linux and Windows.
The quickest way to learn vi keys is just to use vi for your text editing needs. It's a great little editor (I've been using it since the 90s) and the stakes are way lower if you are just editing a Banoffee Pie recipe rather than learning while trying to keep your character from a multi-hour/multi-day session alive in Depths.
You'll have muscle memory of all the keys in no time.
I'm not of much use for this but at least this:
Tabs were introduced in Vim 7 (2006), before there were only buffers. You would use set hidden
and such to make working with buffers easier.
When tabs were introduced it became clear, that they're more like "views" on open buffers, or layouts.
So I guess, a lot of users never started using tabs and just need a modern replacement for minibufexpl from 2001.
Vim is just a text editor, and inherently has nothing to do with Python. Sure, you can edit Python code in Vim, but you’re not “compiling Vim with Python”. That makes no sense; Vim is written in C.
Just install gVim on Windows: https://www.vim.org/download.php
Be sure to run vimtutor to learn keybindings.
The default version of Vim installed on Pop OS is Vim-tiny, a minimalist build of Vim:
Package: vim-tiny Version: 2:8.2.0716-3ubuntu2 Priority: important Section: editors Source: vim Origin: Ubuntu Maintainer: Ubuntu Developers <> Original-Maintainer: Debian Vim Maintainers <> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1,575 kB Provides: editor Depends: vim-common (= 2:8.2.0716-3ubuntu2), libacl1 (>= 2.2.23), libc6 (>= 2.15), libselinux1 (>= 3.1~), libtinfo6 (>= 6) Suggests: indent Homepage: https://www.vim.org/ Task: minimal Download-Size: 594 kB APT-Manual-Installed: yes APT-Sources: http://us.archive.ubuntu.com/ubuntu groovy/main amd64 Packages Description: Vi IMproved - enhanced vi editor - compact version Vim is an almost compatible version of the UNIX editor Vi. . This package contains a minimal version of Vim compiled with no GUI and a small subset of features. This package's sole purpose is to provide the vi binary for base installations. . If a vim binary is wanted, try one of the following more featureful packages: vim, vim-nox, vim-athena, or vim-gtk3.
Some "non-IDE" options:
aspell can be used from vim. An extremely long time ago I was providing a plugin wrapping aspell/ispell.
"Now" that vim integrates a spell-checker, I've stopped working on it, even if aspell if far superior regarding alternative suggestions, and if the plugin was a little more ergonomic (IMO) when considering replacements. It may still work. I don't know.
git clone https://github.com/vim/vim.git This should be the latest version. cd into the clone directory ... and now I can't tell you how it looks in Ubuntu. I use Archlinux so it works a little differently for me.my steps cd vim -> makepgk -si Follow the build steps .... and I'm done
what's wrong with the gvim82.exe on the official site: https://www.vim.org/download.php or this official repo here: https://github.com/vim/vim-win32-installer/releases ?? I don't know that much about binaries and executables, but I would trust the official sites more..
There's this.
https://www.vim.org/scripts/script.php?script_id=5081
Not updated in a while and I haven't used it myself. I would have thought there might be more demand for this kind of thing, but this is the only one I saw.
I think your best chance is follow something like this (https://stackoverflow.com/questions/707107/parsing-visual-studio-solution-files) and use the built-in Microsoft .NET APIs to parse the solution file. In particular, from the thread, seems like you can call <code>Microsoft.Build.Construction.SolutionFile</code> to get a parsed object. You just need to write some PowerShell scripts (or C# if you don't mind having to run compiled code for a Vim plugin) to help implement some basic plumbing and you should be able to invoke your PowerShell script from Vim and get the data you want. It does require some work though and not a pre-made plugin that has everything set up (but you can release yours as a plugin!). Also I haven't looked closely to the API to know if you can use it to manipulate the project which seems to be what you want to do as well.
For pre-made Vim plugins, I remember looking into it way back when I used VS at work and it was a pretty sad landscape (probably due to lack of overlapping interests). There are super old plugins like this but they don't seem maintained.
100%! I though "this has got to be a thing", and found https://www.vim.org/scripts/script.php?script_id=88, but it's long-unmaintained. The help page suggests loading random vim-tip-wiki pages as a more active alternative but tbh I can't find out how after the Fandom Wiki UCP migration.
> What does Vim with GUI mean? I know, that the terminal Vim runs in the command prompt, but I'm not sure what do you mean by 'GUI'. Is it the toolbar at the top of the program, which you can navigate with the mouse, or is it the fact that it just doesn't run in the command prompt?
You can think of GVim as a very specialised terminal emulator designed to better integrate Vim in a GUI-based workflow: system copy/paste and drag and drop, better colour support than what was available at the time in terminal emulators, better font support, etc.
> Why does the zipped version of Vim on the vim.org website doesn't have the toolbar at the top of the program?
There are several zip files listed at https://www.vim.org/download.php. Which one? See :help 'guioptions'
for enabling/disabling GUI-specific features.
> I've also tried Neovim, but it only runs in the command prompt, is there a way to make it run like a regular program? (like Notepad or Vim for example).
The Neovim subreddit is that way: r/neovim.
> How can I change the language of the toolbar in Vim? I've tried following some tutorials on Stack Overflow/Super User, but they don't work. Is there a way to do it with just one command?
:help multilang-messages
> What is the difference between Vim and gVim?
GVim is a GUI wrapper around Vim. Everything you can do in Vim can be done in the exact same way in GVim and everything you can do in GVim (except for the obviously GUI-specific stuff) can be done in Vim.
Popup windows were introduced in Vim 8.2 back in December, Neovim doesn't have them natively. You might be able to find third party plugins to support it in Neovim though.
Hang on. It appears you don't know anything about vim:
> VSCode runs on windows, linux, macos. vim runs only on linux. You wanna run it on windows? You'll have to install cygwin and bunch of other stuff. Add to it whatever you need to install on osx to run it as well.
Incorrect, I run Vim natively on Windows without any emulation layer (cygwin or otherwise). Vim runs natively on Unix (Linux, BSDs, Solaris, SunOS), PC: MS-DOS and MS-Windows, Amiga, OS/2, Macintosh, Android i/OS QNX (ftp) Agenda Cygwin (with GTK GUI) Open VMS and MorphOS.
> VSCode offers much more functionality for developers than vim,
Sure, but not a lot more. If I've got syntax highlighting, code-completion, embedded terminal (on all platforms), interactive documentation browser, code reformatting ... I'm pretty much set. Sure, I'll need a little bit of work with refactoring because I'll be doing it via regexes, but it's only a few minutes more than having language-supported refactoring.
> You can sorta add some programmer related functionality to it via scripts.
What's wrong with having plugins? Doesn't VSCode have the same thing?
> And of course you then think that millions of people who use VsCode instead of vim are somehow stupid,
I didn't say that.
> because in your opinion they could've get the same funcitonality out of vim.
I didn't say that either.
> You will not get the same funcitonality out of vim.
I didn't say that either; I said you'd get about 80% of the functionality for less than 2% of the resources
I've already addressed all the functionality you thought Vim would not have. I'm curious to see what functionality you find in VSCode that isn't in Vim. After all, I guessed that VScode has slightly more functionality, but I wanna see what it is that is so important in VSCode that the extra 1.3GB is necessary.
I use both, and VSCode is no IDE either.
If you want to use Vi, get Vim for Windows GUI, edit with gvim app.py
but with a GUI window; there's no reason to have it stuck in a command prompt window in text mode UI in this day and age, unless you are actually using SSH (and even then X-Forwarding exists and remote editing exists).
> I am used that tools and languages have an official github and docs.
Github is a proprietary third party service, it's not the standard home for any free software project. Vim is older than Github and has always had its own website.
> I have searched vim.org but only found links to books
You should've searched better
https://www.vim.org/docs.php which links to https://vimhelp.org/
>don't have access to Vim at work, and that's where I do a vast majority of my coding
This seems like a problem in itself. Most jobs will let you request software, and vim should be the easiest for them to support. What privileges do you have on your workstation? You could download binaries or compile your own vim, out of your home directory for example. On mac or linux you could do this with homebrew. Or look here, eg for windows there appear to be standalone executables (don't need ot run the installer)
https://www.vim.org/download.php#pc
"GUI executable" might be the one
It sounds to me like your problem could easily be solved by making some changes to your editor.
Why not set <code>path</code> to something like $PWD/**
when starting so you can use :find
and friends to quickly open files?
I'm sure there's a plug-in for vim that lets you select a file from an automatically generated list of all the files in the "current" project. Perhaps something like FindFile.
Emmet is overrated, IMO. I don't want to learn a special language to generate complex tags which I'll never need and likely will require twenty tries to get the right structure for anything non trivial anyway.
I prefer xmledit, basically it just completes the end tag when you press >
, do it twice to open a new line. That's it, quite simple. Basically, you only need to write XML/HTML as normal, and xmledit will do the annoying bit.
I have also come across this poll result by donors, where the third most sought feature is add integration with Python instead of inventing more Vim script. I can understand that this must be really old, And then there is this Github issue, where people did ask for Python and Lua based scripting features (including me) but those comments were deleted for some reason.
I myself included a snippet to demonstrate how utilizing a mainstream language like Python would benefit the plugin authors with the following code snippet, which I use to fix my uncommitted ruby code to satisfy some style:
@command_map("FixAllRubyDiffs")
def fix_all_ruby_diffs():
subprocess.call(
["git", "fetch", "origin", "master"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
current_branch = next(
br[2:]
for br in subprocess.check_output(
"git branch", encoding="UTF-8", shell=True
).split("\n")
if br.startswith("*")
)
complete_diff = subprocess.check_output(
f"git diff origin/master..{current_branch}",
encoding="UTF-8",
shell=True,
)
for diff in whatthepatch.parse_patch(complete_diff):
try:
snake.command(f"e {diff.header.new_path}")
for change in diff.changes:
# If it is an addition
if change[0] is None:
snake.set_cursor_position((change[1], 0))
snake.command(".RubyFixStringsAndHash")
except snake.vim.error as vim_error:
snake_echo(f"Error occured: {vim_error}")
I do not know any complete org-mode implementation outside Emacs, Vim do have an org-mode plugin but is essentially only a thin wrapper around folding, other modern web-app do render org-mode and sometimes they also support a bit of editing, but nothing complete, examples:
Unfortunately a real "shared notes" support for now is far from being near. You can export from Emacs to html a nice static wiki, but to read notes, not to edit them. Org-roam do have a server that let us travel our note graphs, search them, see "portion" of the graph etc but again is for reading not for cooperative edit.
However as many says here you can have Vim in Emacs, non vimscipt (but I bet you do not like it much), but Vim modal editing with :
commands you know, not all, but many. I was a hardcore vimmer for years and years, and after trying Emacs I never looked back, it's my WM, PIM suite, mail client, feed reader, ....... so it's worth a try and if you already know Vim well the change will be quick even with a bit of initial friction/frustration.
It depends on your definition of best...
vim is a great tool to learn and use. It is extremely customizable, there are many plugins already available, and you can also write your own customizations using vimscript. You can integrate git, PHPUnit and other tools into it.
vim is free, comes out of the box with many linux distros, so no matter where you end up and on what project, you'll most likely have access to vim. This can be very nice if whatever other editor you like to use is not available.
PHPStorm is quite likely the most feature rich PHP editor out there, it has an insane amount of convenient features, but it is a commercial product, requires a license, meaning a yearly fee, so it's not a guarantee that the place where you end up working will pay for the license.
The amount of awesome features included into PHPStorm would be a pretty long list, but you can read up all about that on their website.
I created a vim script that may help simple_highlighting.
This plug in lets you save search patterns or whole words into one of 8 slots. You can then set the search pattern to one of he highlight slots. You can also save/ load highlight slots from files.
syntax highlighting is syntax enable
away. Either intercatively with :syntax enable
or permanently by putting that in your ~/.vimrc
file.
Automated brackets closing is something that is very easy to set up. I think the easiest is just inoremap { {}<left>
for curly braces (and just modify for whatever other sort of braces you want). but autoclosing is somewhat ideosyncratic. Maybe you want your braces closed on a separate line or something like that. It is easy to set it up however you like.
When you say suggestions, you probably mean autocomplete. Vim has very powerful built in autocompletion, but the interface for it is awkward. I wrote a (10 line) script to use the tab key, mostly just figuring out whether I want a completion or an actual tab, and what kind of autocompletion I am most likely to require given the circumstances. Many other people use plugins. As for what plugin, my friends who use autocompletion plugins swear by deoplete, but your options are varied.
I don't know what "some vim IDE" means. I guess you might mean an IDE with vim keybindings? You are welcome to do this if you really want to. I have always found this idea strange (why would you want to make something else act like X, rather than just using X?) but many people do use them.
Vim is not really an IDE, but it is a very powerful text editor. That said, since the configuration language is turing-complete, you can literally get it to do anything (check out this). Some people leverage this fact and enjoy using plugins to siphon IDE style features into it until it acts like an IDE. You may do this also.
I used the Vim editor on my computer, a few fancy regex-based find-and-replace commands took care of most of it. Had to just enter the header row manually.
If you edit your notes with Vim, and find that markdown highlighting is occasionally too rigid, you might try the Txtfmt plugin. It turns Vim into a sort of WYSIWYG "rich text" editor, with convenient mappings for applying and removing persistent highlights: e.g., bold, underline, italic, foreground/background colors. It can even be used in conjunction with other note-taking or markdown plugins that provide their own syntax highlighting.
If you want to use vim under Windows you can also just use vim.org binaries or if you want a somewhat compatible Linux wrapper, that performs faster than WSL, use msys
Running it through WSL means that there is a translation layer for working with windows native paths and tools, with WSL2 you have a virtual machine in between the regular files and windows files
If you're willing to pay, Adobe Dreamweaver is pretty good. For more interactive websites, you could use something like WebStorm. Then again, all of these are just glorified text editors, so you might as well look into one of those instead.
The wiki mentions the Smart Tabs plugin, so maybe all you need to do is install it?
(There's also :set copyindent, which you may like, but I'm not sure it alone can be smart enough to handle all the cases.)
As far as I understand it, WSL isn't meant for graphical applications (at least not yet). You can in principle use them if you set up an X server, but it is not exactly trivial.
As an alternatives, you could try using the text mode version of vim. Or if you want to use gvim, there seems to be a native version for Windows (see https://www.vim.org/download.php).
> Is this really impossible?
Yes.
> Is there any way of tricking vim into thinking that e.g. the cursor is on lines 2, 3 and 4 simultaneously and highlighting accordingly?
No.
> Maybe failing that, I could disable the built in linenumbers and draw one myself.
Before :help 'relativenumber'
was a thing, the feature was available through a plugin written by Dr Chip. Maybe you could get inspiration from his code?
Check out:
Both offer similar functionality to yours and Projectionist is offering also a little bit more.
I only ever use h
& l
within the span of single words, but the instant precision of relative line numbers (& absolute at the same time for the current line’s number) leaves me using it exclusively for all vertical movement.
Combine that with an ergonomic keyboard that has open-source firmware (and special consideration for those who would want to customize their firmware), and I’ve got my entire numpad on an easily accessed layer that leaves my hand on the home row for touch-typing numbers the way I was taught in junior high.
In fact, I’ve got my regular arrow keys under my other hand, and am thinking about “un-repurposing” them so I can do simple single-character movement in insert mode (e.g. typing an open-close pair of brackets/quotes, then typing its contents.
vim itself is a powerful text editor that, once you learn it, is incredibly efficient at editing code. Because it's so popular with programmers it has a very large catalog of plugins and supports practically every file type.
It's also incredibly customizable because it has its own programming language and any plugin you add actually adds new commands to the editor, so creating shortcuts is as easy as connecting the keys to the commands and parameters you want to call.
So it's a text editor that you turn into your own ide by adding whatever plugins you want.
I mean, we're on thread about whether we should change a technical term because people are offended. Personally, my intuition is that this whole thing is as silly as discussing how many angels can stand on the head of a pin, whether Superman would beat Goku, whether vim or emacs is better (it's Vim, of course), whether one should indent with spaces or tabs, or whether the dress is blue and black vs white and gold.
Some of those I happen to have very strong opinions about and others I couldn't care less about. But in all cases, the only reasonable argument is to leave people to argue silly and go do something worthwhile in the meantime. Being reasonable is not allowed, only extensive research into the philosophic leanings of the creators of Superman, at the time of inception, to try to guess what the authors intended for his power limit to be. There is no other way.
All this to say, it's objectively silly but also objectively important because the whole debate is about this tactic being condoned as Serious Business. So, let's actually come up with the surface integral for the head of a pin, calculate bounds for the number of angels possible and narrow it down as much as possible. When in clown world, put on a red nose and say honk.
> And please note I said "mostly accurate" precisely to cover myself from this sort of criticism ;)
I can't argue with a perfect defence.
Not much of this was Python specific. Something that rarely comes up in these "Vim for x" blog posts is syntax files (:help syn-files
). To be honest, I've not taken the time to dig deeply into writing my own (although I really should as I'm not entirely happy with jsx handling), so here is the Python syntax file I use, and here is another.
But seriously, you probably don't need any unusual layout, but as a compact keyboard user, I can recommend a keyboard that doesn't have all its keys spread out. I use a a Poker 3. I do not use Emacs.
The HHKB probably is Emacs friendly.
But you can get a keyboard that allows you to remap keys as you want and get the same benefit.
The usual positions of Ctrl are fine for me. I use keyboard driven interfaces all the time, but not Emacs. My CapsLock key is used for the Fn key on my keyboard. I don't have a Caps Lock mapped to anything. It is useless.
Nice idea but it has been done before in a few different ways. The main two I can think of are a.vim and vim-projectionist. vim-projectionist is a bit more involved but also a lot more flexible in what it can do, it also does more than just alternate files which may or may not be what you want.
I'm both giving my macros and key setups, hope it helps!
In case you are curious about the links:
The Vim editor, while powerful, can be hard to use.
I can't visualize anything, but I sort of do something like the editor vim. I imagine a bunch of "registers", just numbers that are important for the problem I am doing, and somehow manage to hold on to them while I am doing another part of the problem. Sometimes it goes haywire, and I forget a number or whether or not I have added or done something else to it and I have to start over. Somehow I do this all without visualizing the numbers. It's like when you read a word, and you know what word you have just read, but you can't see it in your head anymore.
Anyway, it works well enough where I can do the SAT without a calculator.
No problem, and thanks!
I'm not well-versed with terminals, but I had done this Vim theme a few years ago back when I used vim primarily, and IIRC it worked well with 256-colour terminals.
If you want to stick to 16, tho, then you could pick and choose those 16 colours in say ~/.Xdefaults
(or some other file and then xrdb -merge
it in your .xsession
or similar). There, you pick the colours you want, you could try to say port paper-theme colours over, come up with your theme (this could be helpful for both) or just grab a pre-made theme like Solarized or Dracula (Dracula, together with Misterioso and paper, are my favourite themes besides Emacs default, BTW; really vibrant yet balanced), and enjoy the added benefit that the colours apply to all apps that support that way of theming.
In my setup I use GUI Emacs exclusively, avoid curses apps, stick to M-x shell
, and just disable all colour in the shell: (setf ansi-color-for-comint-mode 'filter)
makes Emacs just filter out all relevant control codes w/o applying them (because so many devs hardcode colours which later don't adapt to different setups, and many CLI apps use excessive colour).
Vin is available as a windows download. https://www.vim.org/download.php#pc
Nano is available as a package in chocolatey, although I'm not sure you'd want that on your server.
But aside from that the pickings seem very slim indeed.
A very simple solution will be to have something like below in .vimrc
(this needs to be run before any file is read that has a swapfile)
autocmd SwapExists * if getftime(expand('<afile>:p')) > getftime(v:swapname) | let v:swapchoice = 'd' | endif
Brief explanation (run :help
on any of these terms to get detailed definitions)
SwapExists
This is the event that is triggered when vim detects a swap file. We are setting an autocommand for it
'<afile>:p'
Contains the full path to file in the current buffer
v:swapname
A global variable containing the name of the swapfile. This only exists during SwapExists event.
v:swapchoice
Another global variable. Setting this tells Vim what you want to do with the file. 'd' means delete the swapfile. Other options are 'e' for edit anyway, 'o' open read-only, 'r' recover, 'q' quit and 'a' abort.
getftime()
gets the last modified time of the file
So basically this command checks if the last modified time of your original file is more recent than the swap file. If so it deletes the swap file.
This is obviously a simple example and does not cover all cases. You can write a function to cover other cases as well. Also write an augroup
so that you can delete it easily. A plugin like autoswap.vim which covers most of the cases is also another option.
Something like this might work:
function! Tail()
e
redraw
sleep 1
call Tail()
endfunction
Though it'll block on that sleep
. There are also some plugins out there, but I haven't tried them:
Well, if you're using Linux, there are a few text editors that work from the command line. I'm probably getting this wrong (as a Windows user), but, Vim? Nope, name is right.
On Windows, you can configure Notepad++ (and probably a few others) to display the text green on a black background. Notepad++ is aimed at programmers, so it numbers lines and highlights the active line by default. This may or may not be something you want, but you can configure the highlight colour as well.
Seconding ctags: It's really great for going to the definitions in a quick ctrl-] manner.
When I need to see the overall picture and view a call tree I use cscope with CCTREE
This allows me to have a great calltree in a left split that I can easily switch show more or less depth and find out what calls these items.
I find that using a combination of tabs and vsplits is really helpful. I can do
:tabedit filename.c
:vsplit
and
:vsplit otherfile
Lastly the most important thing is to recognize when reading the code is not enough, and how to get comfortable using the debugger of your choice. This is a great example where tmux where you have a split of your command line and vim. Depending on the codebase and your debugger having the code open in vim is more helpful than say the gdb TUI.
Vim is what I use. Some other people use Emacs or Sublime Text. It's all personal preference. They all have support for a large amount of languages and auto completion which is really what most people need. Vim is harder to learn than most editors, but it has a huge community behind it with quite a few plugins.
Nobody really uses notepad anymore since it's so outdated and VSC is basically a bloated text editor that doesn't even have near as many features as others.
I have been using https://www.vim.org/scripts/script.php?script_id=1757 together with lbdbq and mutt for more than 10 years now. Never missed anything.
(Actually, I use my own version https://www.256bit.org/~chrisbra/cms/Z-files/lbdbq_complete.vim)
This voom plugin looks useful for my outlining purposes and can be used with markup: https://www.vim.org/scripts/script.php?script_id=2657
Has anyone used this?
The compile flags will work even in Windows. If you're looking for a pre-compiled binary, Vim's website (https://www.vim.org/download.php) mentions a link to it around "It supports many interfaces, such as Perl, Tcl, Lua, Python and Ruby.". The link goes to their GitHub release page: https://github.com/vim/vim-win32-installer/releases.
Those should work for you on Windows without much setup
Many, many IDEs and Code Editors integrate Vi/Vim functionality, and it’s very easy to use directly on the Console. For example, on Mac you can use Vim directly in Terminal or with an application like MacVim.
See more: https://www.vim.org/download.php
One does not simply start using vim.
I would start over.
Uninstall everything you just mentioned and start over.
Install the latest version of Gvim for windows.
Do the vim tutor.
$vimtutor
Learn slowly and properly.
Get used to vim and learn how to use and install plugins properly when you're more comfortable.
I'm not really asking for support. I'm more curious if there is some back story, or if it's generally something that people are aware of and just ignore or what-have-you.
The idea that it's www.vim.org and not vim.org is the sort of info that's of interest.
And like, why is it that way?