315 points · by liuchengxu · 9y ago · 152 comments
I still keep vim around for huge files though. I work daily with NASTRAN input and output files, routinely multiple 100 mb, sometimes multiple-gb. I edited a 10gb file earlier this week and vim didn't choke up too much. Best editor I've found so far for huge files.
That being said I've used PyCharm on a system with 2 GB memory before and that does work okay, you just need to make sure that no other memory-hungry apps run at the same time (browser, email, multimedia) and that the system itself doesn't use too much memory.
Well, for all of their benefits Electron apps in general have some hiccups on resource constrained systems.
Edit: realized you're probably talking about vscode, which is an electron app
But sometimes there are merge conflicts. I've settled for xpra and kdiff3 as the mergetool. I just can't handle the problem without a GUI tool.
If I need to do something significant, i'll scp the file around. I know vim can edit over ssh, but I honestly never do.
I've never tried vscode, but I am tempted to try the remote support: https://github.com/DonJayamanne/pythonVSCode/wiki/Debugging-...
In ubuntu it's file -> connect to server -> type in ssh://username@ip
That's it you are done. You can now browse the files as if they are local and use sublime/gedit/VSCode/Pycharm/whatever you want
sshfs -o Ciphers=aes128-gcm@openssh.com -o Compression=no -o reconnect \
-o modules=iconv,from_code=utf-8,to_code=utf-8-mac \
myremote:/somedirectory/ /mylocalmountdirThis is one of the longest-standing line in my vimrc so far:
Plug 'epeli/slimux'
Works best for what I do.I have a nice 'generic-eval' operator in evil that lets me select via motions and eval the result. This is the best experience I've found so far. Documented here: https://gist.github.com/ad2b435bfdf2ec5f0b4d57aa8ea40df6
The superior solution you are looking for is the package called elpy.
It provides this, linting via flycheck, contextual auto-completion via company-mode, etc etc.
I wouldn't know how to survive without it. It's almost a full IDE in itself.
[0]: https://github.com/jzelinskie/dotfiles/blob/master/.vimrc
[1]: https://github.com/jzelinskie/dotfiles/blob/master/.zshrc
Even though I write ruby and javascript all day, I still like to go and read how others are using vim. I usually walk away with a keybinding or plugin that makes my life better.
For the most part, when I need this, I revert to Rodeo (since it has vim bindings like RStudio's), but if I could ditch it that would be amazing. Nothing against Rodeo or other editors, but vim habits are hard to break.
I admit I have never used Vim or Emacs but the tutorial was enough to do movement and I also read this wonderful documentation as well: First this here which gives a wonderful overview of the whole philosophy behind SpaceMacs:
http://spacemacs.org/doc/DOCUMENTATION
Then I took a look at this just to get some better idea of how to do certain things with the layers since it's very dependent on a layering system:
http://spacemacs.org/doc/LAYERS.html
And for good measure since Evil mode emulates Vim I thought it might be nice to see what this had to say:
http://spacemacs.org/doc/VIMUSERS.html
It took me like a week to be efficient but now I'm flying so much faster than I was with VS Code or Atom. I still use Sublimr Text for some things because I like it but this is a great editor and has a lot of potential and is extremely extensible with Emacs lisp and I believe they already have a way to bridge in Vim plugins too
Not to mention you can share your command line shell session/screen with other people!!
tl;dr, use tmux if you ssh into places and hate restarting after losing your connection.
Man. https://linux.die.net/man/1/tmux
Or if you're not into the whole brevity thing: https://linux.die.net/man/1/tmux
Try it with a friend the first time.
Using tmuxinator, I might set up a config for a rails project, for instance.
That way when I start tmux I get a vim editor in one window, a bash prompt in the next (for git), a rails server in the third, tests in the fourth, maybe another process in the 5th like sidekiq or something if required. Note, these (tmux-)windows all live inside of one terminal window.
So once you spend about 2 minutes writing that config, you can always start up your environment with tmuxinator start project-name and a few seconds later you're good to go.
Screen is a similar program.
That's why, while I use VIM when I have to, I much prefer the technology to handle automatically whatever it can. Like maintaining states, making them obvious and offload any fruitless decision making.
I use a macbook pro with iterm2, and I prefer to use a terminal multiplexer instead of tabs or the native screen split of iterm2.
If you ssh remote boxes a lot, it is very useful because you will not lose your session in case of an occasional disconnection.
ssh hostname -t "tmux -CC attach || tmux -CC"
Of course, I picked this up from an HN comment :)I also really like you "space-vim" project. Another similarly named project — "SpaceVim" http://spacevim.org/ — was posted recently. "SpaceVim" was really upsetting because it missed so many of the important ideas of Spacemacs, such as pneumonic keybindings. "SpaceVim" is a garden variety vim distribution coopting the "Spacemacs" name, but you stayed true to the "Spacemacs" principles. Nice work!
why I create SpaceVim, instead of support space-vim, I think space-vim is just a copy of https://github.com/ctjhoa/spacevim and https://github.com/Tehnix/spaceneovim-layers and https://github.com/Tehnix/spaceneovim
BTW space-vim's some syntax script is copy from https://github.com/junegunn/vim-plug and install script is just copy from spf13.
so I do not want to support it, but when I create SpaceVim, and post blog anout SpaceVim, the author of space-vim comments a lot of unfriendly message.
and here is the link.
so I will apologies to all the people who receive my emails about SpaceVim, but I will not apologies to the author of space-vim.
The maintainer of the competing "SpaceVim" project I mentioned just opened an GitHub issue on my personal dotfiles repo to spam me with his project: https://github.com/superquest/dotfiles/issues/1
Bizarre.
I think that's the first time I've ever gotten a personal email because I starred someone else's repo!
I'm talking the full shebang.
* Autocomplete/Autoimporting (Static Analysis backed by compiler output)
* Formatting
* Linting
* Fast or able to run over a slow SSH connection.
* Default error resolutions (if test() throws an exception generate a try { })
* Global refactoring
* The idea of a project (Creating, building, export/importing, libraries, dependencies)
* Automatically generated & maintained building system at the click of a run button
* Documentation at a single click or on hover if possible
* Integrated console for running a project
* File and source manager that should be easy to use
* Binding profiles for Eclipse, NetBeans, JetBrains, VS20XX, ReSharper
Optionally these would be nice: * Formal Method Verification?
* Coloring/styling of the entire TUI
* Simple to interact with menus
* Rust, Go, JavaScript (Browser & Node), Java, Scala, C, C++, PHP, Python support
* Pluggable language support that allows the plugin to provide static analysis & compiler data
If that can all be provided that could easily sell for $25 to $50 per user and I'd be happy, happy!, to pay every last dollar of it. It'll never happen. The world will never be that kind to software developers. [TYPECHECK]
ignored-modules = ssl,pyodbcAdd it to your `ftplugin/python.vim`. Requires you to have activated the Conda environment before opening the Python file, uses hard-coded Python versions, doesn't work with multiple environments, doesn't bother with `os.path.join` so no Windows compatibility, etc etc. Like I said: a hack.
" Cheap trick to use the Conda environment with omnicompletion
python3 << EOF
import os
import sys
cenv = os.environ.get('CONDA_PREFIX')
if cenv is not None:
# Taken from `sys.path` as reported by ipython
sys.path.insert(0, cenv + '/lib/python3.5/site-packages')
sys.path.insert(0, cenv + '/lib/python3.5/lib-dynload')
sys.path.insert(0, cenv + '/lib/python3.5/plat-linux')
sys.path.insert(0, cenv + '/lib/python3.5')
sys.path.insert(0, cenv + '/lib/python35.zip')
sys.path.insert(0, cenv + '/bin')
EOF
set omnifunc=python3complete#Complete
edit: mentioned `os.path.join` to warn Windows users and fixed in-place bugfix.Finally I gave up and moved to NeoVim and have no issues with my vim anymore. Maybe later I will give another try to spacevim or emacs. Maybe. So far, keeping my fingers safe :D
Every so often when vim irritates me I try out PyCharm or vm-whatsit, and while IDE's do have better viz for some use cases, the actual act of manipulating code in-buffer never comes close to speaking vim. And I always add the vim plugin, without them the tool would be of no use to me whatsoever.
I hope someday some tool will eclipse (no) vim, but that's simply not the case in 2017.
PyCharm - No good vim emulation for editing
Spacemacs - Soft locks, Ctrl-] doesn't follow the same word boundaries as Meta-. (which matches Vim's implementation)
Sublime Text - Closest fit (enough that I own a personal license), but again, the vim emulation is pretty bad.
Atom - Slow. Even at its fastest, it's noticeably slower than Vim
VSCode - Slow (though faster than Atom), no good vim emulation.
Yes, most of my criticisms form around the lack of good vim emulation - my muscle memory is very well established. I've just yet to find a good, responsive, and comfortable editing scheme from a non-Vim editor.
I recently switched back to doing Java almost 100% of the time and have been using IntelliJ. There are definitely a lot of Java-specific features I use very heavily that I wouldn't be able to get without a lot of of time and plugins in Vim. But sometimes I hit weird bugs that highlight the relative complexity of the core, and I often feel frustrated by how light-weight it isn't (granted, I've tried some other Java IDEs and it's amazing by comparison).
But I used to work more with various scripting languages, and my gvim setup just couldn't be beat. So light-weight, but easy to set up again if I needed to. Still able to navigate code structures, debug without context switching. I often did something with a partner that amazed them, because they couldn't do it with their IDE; my favorite thing in the world is the look on someone's face when I select a rectangular section of text and change the indentation without affecting the stuff on the left. It was incredibly productive for years. I still occasionally go back there when I'm working in a single Java file, because the vi emulation mode in IntelliJ isn't quite there and I can manipulate the raw text so much faster in gvim.
More useful, IMHO, is the general solution of jumping to the definition that would be resolved by the python interpreter, regardless of location. For that, the key binding will depend on the plugin. For `jedi-vim`, you use `<leader>d` [0].
Incidentally, if you're new to using VIM as a python IDE, also note the value of `jedi-vim` providing Python docstrings via the standard VIM keybinding `K`. This is also mentioned in [0].