Interface texshop with vim - vim

Any advice on how you would interface texshop on mac osx with vim? I'm using vim quite a lot lately for coding. I find myself now trying to use vim-commands (replace, search, pattern matching, move, etc) when writing documents for latex with texshop and they obviously don't work. However, I don't want to leave texshop altogether, because it has some pretty nice tools I use very often (maybe the most important one is the ability to click the compliled .pdf file while pressing the CMD key on my macbook to jump immediately to the corresponding place in the .tex file).
Thanks in advance!

Can't really help with the question but if you want to use vim I would highly recommend vim-latex suite. It has a lot of mappings and other latex goodness including completion of references/citations (it loads them from the bib file and gives prompts based on what you've already typed). Also it supports pdfsync forward/backward searching - I use that with Skim. There is some information here on how to get that working (and see other posts on that blog).
Are there any other texshop features you would like to reproduce in Vim?

Related

Vi / Vim for project of more than a few files

I typically use an ide for large projects and vi for small single file scripts temporary files etc.
Lately I have heard of people using vi for larger projects too - actually, quite defensive and particular proud to do so.
I have tried, but i found it very cumbersome. Do any other programmers here use vi for and medium - large projects? If so, are there any tips/tricks you can offer for navigating source, looking at multiple files etc?
I have tried using tmux to see if it made things easier - but it still felt quite cumbersome
There is no magical tool that can make everything perfect. Vim is an editor, and it's pretty good at it, but it's not and will never be an IDE.
There used to be the pida project that made an IDE around vim, for better interaction when using python, but it got abandonned.
There is eclim which is a really neat tool that can use eclipse as a backend IDE accessible in a few keystrokes from within vim, while having all the power of eclipse for tagging, refactoring, debugging etc.. But you have to want running eclipse in background, which is like hiding an elephant under the carpet...
There are many little plugins you may want to use, and I'm pretty sure everyone has his favorite set of plugins, that helps navigate easily in the code and help tagging (like fugitive, nerdtree, etc..)
Finally, there is vim, a shell and that's all. Vim does a lot of things correctly, like navigating in the source, launching compilations and parsing the errors etc.. And for what vim is not good at, you can use your shell, to execute, to do git stuff, to open more vim windows to edit code..
Anyway, there's no perfect answer to your question, and I bet your question will be closed because of being "non constructive".
What do you find cumbersome? What works for you? What doesn't? What kind of feature do you need to be able to work efficiently with multiple files? How many are multiple files anyway?
Some people use Vim for working on quite large projects: the Linux kernel, Firefox, Vim itself… I guess that you need to know Vim pretty well to pull that off but it's all very doable, even without many plugins.
But I tend to think "complexity" rather than "quantity".
When I work with "complex" languages+projects (quotes because it is all very subjective) I'll use a more suited IDE with a Vim-emulation plugin: Flash Builder+Vrapper for Actionscript 3, Eclipse+Vrapper (then) Android Studio+IdeaVim (now) for Android.
When I work with "simple" (quotes, again) languages+projects I'll use Vim: that's any project involving HTML/CSS/JavaScript/PHP, from 3 to 50+ files.
File/buffer navigation
Vim is very good at opening files (which sounds funny), even without plugins. :sp **/foo<Tab>, for example, is quick and easy. :Ex foo/bar as well.
Switching buffers is also very easy, if a bit awkward at first. :bn, :bN and :b <Tab> will get you a long way.
And if you don't like those built-in methods, you can create your own cool mappings or choose from many plugins.
"Semantic" navigation
I like to think about my project in class/method names rather than in file names. With an up-to-date tags file (generated with ctags or some compatible program), :tag foo is a very efficient way to move around, <C-]> jumps to the definition of the tag under the cursor and <C-w>} opens that definition in a small preview window. That's more than enough for my needs.
I don't particularly like them but you can also use TagBar or TagList to have something that resembles the class browser of your IDE.
I'd suggest you make your needs more clear and ask more specific questions or look around on SO. The subjects above are pretty well covered.
Just a few pointers: I like NERDTree and CtrlP for easy/powerful file navigation and splits for keeping several files visable and navigatable at the same time.

Change buffers in FakeVim

Does anyone know some shortcuts for FakeVim to change between files?
Is it possible to use buffers in Fake Vim? I accidentally found out that Ctrl+w,w gets you the next window. Does anyone know other? For example getting to the left, right, top, bottom windows?(vim's Ctrl+w,l and others)? Is there any documentation on FakeVim? Is it possible to configure FakeVim's vimrc file to create shortcuts for changing between buffers and the Projects view?
Thanks!
Recently I've been doing most of the changes on FakeVim plugin.
You can find list of Vim commands supported by FakeVim at https://github.com/hluk/FakeVim (recent version from Git master branch).
I'm still not sure how to document the features in Qt Creator. I'll probably implement something like :help <command> in near future.
The FakeVim documentation is severely lacking. This paragraph, for example, is so fuzzy it's borderline irresponsible:
In the FakeVim mode, most keystrokes in the main editor will be intercepted and interpreted in a way that resembles Vim. Documentation for Vim is not included in Qt Creator. For more information on using Vim, see Documentation on the Vim web site.
Basically, without a proper documentation or a look at the editor's source code it's impossible to know what should work, what shouldn't and in which way the behavior of what works deviates from Vim's behavior. And that's what passes for a modern IDE, these days.
Whatever…
I think that your best bet is simply trial and error: since you appear to know how to use Vim you'll have a lot of commands and shortcuts to try.

Vim: How to set up an efficient autocomplete configuration?

I've been using Vim for a while now and love it, but one thing I've noticed when I use other editors is that I've never really got autocomplete working with much efficiency. I have supertab & snipmate working, I have tags for whatever language I'm using set up, but somehow it seems a little too cumbersome to use all that much, and apart from long method names I typically just avoid autocomplete.
Does anyone have fast, comprehensive autocomplete funcitonality set up in vim? Specifically:
At the moment, I hit "tab" to autocomplete class/method/variable names & generate snippets, but Ctrl+X+O for inbuilt langauge commands. I'd rather press tab for everything.
The ordering doesn't seem to be too intelligent. Very common stuff is often hidden in the middle of a bunch of rarely-used commands.
I've set up autocomplpop to show potential autocompletes as I'm typing, but I have to hit tab twice to accept the first entry. One much rather single-tab it.
So, any tips on setting up an efficient, comprehensive autocomplete configuration in vim? I know this question is a little vague - but if anyone has an overview of how they autocomplete well, and/or a link to a guide, it would be much appreciated.
Just thought I'd come back and mention that I finally found something I like: A customised version of NeoComplCache. Nice auto popup, everything integrated pleasantly into 'tab', and with a bit of customisation plays nice with snippets.
http://www.vim.org/scripts/script.php?script_id=2620
This is very dependant on your working domain. Vim is a text editor with the ability to interface with intelligent text-aware mechanisms.
If you are using java there is eclim, which is the eclipse backend together with a vim plugin for the frontend.
For C or C++ there is the plugin OmniCppComplete
It works by scanning the headers in the paths you have set up in vim (see :h path), and works very well imo.
If you have to press Ctrl-X_Ctrl-O for omnicompleteion, then your supertab config seems a bit broken. It should try omni or filename completion first, and then fall back to word completion.
YouCompleteMe plugin by Valloric is a very decent plugins for autocomplete and suggestion.
It contains support for all the major languages and you can extend the feature with setting up different engine .
it also comes with syntax checker so u don't have to use Syntastic separately
For setup details visit this link
https://github.com/Valloric/YouCompleteMe

What's the best thing you've done with vim that helped your programming?

While surfing, I came to know that somebody has done Tower of Hanoi using vim. WOW!!!
Can you people share what all cool things you have been doing in vim.
Edit: Not sure about the Tower of Hanoi solution using vim being all that useful. But I think this question should be re-opened to allow people to comment on any useful things that they've done using vim. For me? See my answer below. (-:
vim has a set of commands that integrate with development tools such as make, gcc, and ctags. You can build your project, navigate to warnings and errors, and jump to function/variable definitions without leaving the editor:
:make builds the project.
:cl lists warnings and errors.
:cc takes you to the to line in the source code that generated the current error.
:cn navigates to the next error.
:cp navigates to the previous error.
:tag name navigates to the definition of the token name. (See man ctags to generate an index of tokens; sometimes make tags will do this automatically.)
Pressing Ctrl+] navigates to the definition of the token under the cursor.
I'm using vim to syntax-color code in my blog and lecture notes. A single Perl line
system "$vimrt\\gvim.exe", qq{
-c "edit /tmp/tmpcode.$ext "
-c "source $vimrt/syntax/2html.vim"
-c "write! /tmp/tmpcode.html"
-c "qa!"};
converts the code into nicely-colored HTML. I know there are stand-alone tools for doing this, but vim is already installed on my system, so this is one less tool to install.
I found myself struggling to be more efficient in vim compared to other non-modal text editors until I learned about "text-objects". Understanding this concept really improved my productivity and also gave me a new way of looking at text which in turn made it easier to deeply understand other vim concepts that I had only understood ephemerally before.
:help text-objects
I was working on a system that had massive log files. We're talking 30,000 10MB logs.
Per day!
Distinguishing between log messages that were coming from the middleware (same company but custom rolled) and our application was getting tedious.
That is until I wrote some custom vim syntax parsing so that anything vim displayed in green was from the middleware (done by the guys in Sophia Antipolis near Cannes) as opposed to anything vim displayed in blue that was from our application software that sat over the top of the SA code.
I also added highlighting to really make exceptions stand out with white lettering on a read background!
Made life so much easier! And it wasn't that hard to do!
Thanks vim!
I couple of months ago I wrote a vim script to save a complete history of all my edits, so I could inspect and measure my programming performance.
I'm using vim a lot recently to edit XML files. I got the xmledit plugin for vim working. Now vim creates closing tags for me, I can enclose highlighted text in an XML tag, and jump to balancing XML tags. It saves a lot of repetitive typing, reduces mistakes, and increases my productivity.

Text Editor For Linux (Besides Vi)? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby.
Doing a google search yielded outdated answers.
Edit: Since there has been some concern about the 'merit' of this question. I am about to start a new Ruby Programming Project in Linux and before I got started I wanted to make sure I had the right tools to do the job.
Edit #2: I use VIM on a daily basis -- all . the . time. I enjoy using it. I was just looking for some alternatives.
http://xkcd.com/378/
Emacs is a wonderful text editor. It has huge power once you become a power user. You can access a shell, have as many files open as you want in as many sub-windows and an extremely powerful scripting support that lets you add all kinds of neat features.
I have been using a ruby-mode which adds syntax highlighting and whatnot to ruby, and the same exists for every major language.
If you keep at it, you can use exclusively the keyboard and never touch the mouse, which increases your editing speed by a significant margin.
If you want to start with something a lot more basic though, gedit is nice... it has built in syntax highlighting as well for most languages based on the filename extension. It comes with the OS as well (though emacs you can easily install with apt-get or some similar package finder utility).
UPDATE: I think gedit is exclusively GUI based though, so it would be useful to learn emacs in case you are stuck with just a shell (it is fully featured in both shell and graphical mode).
FURTHER UPDATE: Just FYI, I am not trying to push Emacs over Vim, it's just what I use, and it's a great editor (as I'm sure Vim is too). It is daunting at first (as I'm sure Vim is too), but the question was about text editors on Linux besides vi... Emacs seems the logical choice to me, but gedit is a great simple text editor with some nice features if that's all you are looking for.
Kate, the KDE Advanced Text Editor is quite good. It has syntax highlighting, block selection mode, terminal/console, sessions, window splitting both horizontal and vertical etc.
I use sublime Text on linux.
Try Scribes . It tries to be a TextMate replacement for Linux
2020 edit: forgotten in the mists of history
I use SciTE
very small and simple text editor.
I like the versatility of jEdit (http://www.jedit.org), its got a lot of plugins, crossplatform and has also stuff like block selection which I use all the time.
The downside is, because it is written in java, it is not the fastest one.
I find Geany (http://geany.uvena.de/) quite good.
I use pico or nano as my "casual" text editor in Linux/Solaris/etc. It's easy to come to grips with, and whilst you lose a couple of rows of text to the menu, at least it's easy to see how to exit, etc.
You can even extend nano, I think, and add syntax highlighting.
Alternative text editors? Try Diakonos, "a Linux editor for the masses". The default keyboard mapping is as expected for cut, copy, paste, undo, open, save, etc.
When I searched for TextMate alternative for Linux, I ended up using Geany. It's not as powerfull, but still nice to work with. Great replacement for Kate.
On Mac OS X, I have used BBEdit since the early 1990's, so I use that as my reference for all other editors. I sometimes use BBEdit to edit files on a Linux box using ftp mode, and that works very well if you have a fast network connection to the Linux box.
I learned emacs two years ago because the rest of the programming team I joined uses it. I find emacs powerful but annoyingly old-fashioned in many ways, but once you have learned emacs, you can use it on any platform (Linux, OS X, Windows). This is the editor I use almost exclusively at work now. It is going to take me years to master all its features, though.
I have also used gedit on Linux and found it very usable, but I haven't tried to use it as my primary editor for any project.
I have a colleague at work who uses Komodo Edit 4.4 (free from activestate.com), running it on a Windows computer but using it in ftp mode so she can edit files on our Linux server. Komodo Edit has many nice features, but it takes a looonnnggg time to launch the first time.
Don't forget NEdit! Small and light, but with syntax highlighting and macro record/replay.
Best one besides Vi? Vim.
SciTE
http://www.scintilla.org/SciTE.html
The best I've found is gedit unfortunately. Spend a few hours with it and you'll discover it's not so bad, with plugins and themes. You can use the command line to open documents in it.
+1 for pico/nano -- lightweight, gets the job done, good help
Friend of mine swears by jed, http://www.jedsoft.org/jed/
First I don't want to start a war..
I haven't used TextMate but I have used its Windows equivalent, e-TextEditor and I could understand why people love it.
I've also tried many text editors and IDEs in my quest in finding the perfect text editor on Linux. I've tried jEdit, vim, emacs (although I used to love when I was at uni) and various others.
On Linux I've settled with gEdit. Although I do use Komodo Edit from time to time. When I'm in a hurry I use gEdit purely because it is quicker than Komodo Edit.
gEdit has plenty of plugins and comes with some nice colour schemes. I reckon once gEdit has a proper code-tidy facility it'll be cool.
I think the only reason I use Komodo Edit is the project file facility.
I have a friend who donated his 'Vi Improved' book in the hope that he can convert me to Vim. The book is over an inch thick and completely put me off in investing time in learning Vim..
Everytime I find an editor - I always find myself going back to gEdit. It is a frills-in-the-right-places editor. Give gEdit a go, it is the default text editor in Ubuntu and Linux Mint.
Here is a link to an excellent guide on how to get gEdit to look and behave (somewhat) like TextMate:
http://grigio.org/pimp_my_gedit_was_textmate_linux
Hope that helps.
I agree with Mike, though I'm a Vim die-hard. I've been using GEdit quite frequently lately when I'm doing lightweight Ruby scripting. The standard editor (plus Ruby code snippets) is extremely usable and polished, and can provide a nice reprieve from full-strength, always-on programming editors.
I've just started using OSX. Free editors of note that I've discovered:
Komodo by ActiveState. No debugger or regex editor (although one comes with Python, i.e. redemo.py) in free version but perfectly usable.
ERIC, written in PyQT.
Eclipse with PyDev is my preferred option for editing Python on all platforms. Nice clean GUI, decent debugger. Good syntax parsing etc.
I've used Emacs for 20 years. It's great and it works everywhere. I also have TextMate, which I use for some things on the Mac (HTML mode is great). If you want to do Ruby development, Netbeans supports Ruby and it also runs on all platforms.
http://www.netbeans.org/features/ruby/index.html
I've seen some blogs, etc claiming that it's the best Ruby environment available.
I use joe for simple (and not so simple) editing when I'm away from Eclipse.
It uses the classic Wordstar keybindings- although I've never used Wordstar, it's a selling point for many people.
It's easy, well-supported, light-weight and it has binaries available for everything.
I love Kate because it has several interesting features (already cited) usually found in (heavier) IDEs. My favorite feature, however, is its terminal window that is very practical for quickly performing the save-compile-execute combo.
Nedit is another valid option, packed with lots of features (and it hasn't lots of dependencies: that's a huge plus IMHO).
For editing in a shell, when I cannot use VIM, I look immediately for pico or nano (but I would not recommend them for continuous development: for rapid editing they are perfect).
If it's just you? Use what you want to use today; switch in mid-stream if you want.
Is it a team? Try to be editor-agnostic. Set standards for white-space (are tabs allowed? How many spaces does a tab represent?), but otherwise allow anyone to use whichever editor they want.
Is it a team doing pair-programming? That's where you may need a team-standard editor, just so that programmers can easily pass the keyboard.
To help implement a standard white-space policy in a shop where one or more coders is using Emacs: You can tell Emacs about your white-space policy with some comments stuck at the bottom of every file source file. For example,
# Local Variables:
# tab-width: 2
# ruby-indent-level: 2
# indent-tabs-mode: nil
# End:
Anyone using emacs (or xemacs) on that file will automatically get the group standard indentation.
Sublime Text 2 is my favorite.
Intuitively understandable and quite powerful.
You can try Emacs with ruby-mode, Rinari (for Rails) and yasnippet which provides automatic snippets like Textmate.
TextMate is a great editor, and there is a way to replicate some of the functionality in GEdit. Check the article out here: http://rubymm.blogspot.com/2007/08/make-gedit-behave-roughly-like-textmate.html to modify GEdit to behave like TextMate.
Vim is a nice upgrade for Vi, offering decent features and a more usable set of keybindings and default behaviour. However, graphical versions like GVim, KVim and even Cream are extremely lacking in my opinion. I've been using Geany a lot lately, but it also has its shortcomings.
I just can't find something in the league of Programmers Notepad, Smultron or TextMate on Linux. A shame, since I want to live in an all open source cyberworld, I'm stuck hopping from one almost-right editor to another.
I personally use MacVim which is basically a GVim for Mac OSx. However I have been reading alot about Redcar, which is a text editor for Linux, which shares a lot of the Textmate functionality. Checkout the links below.
Redcar
LURG Lecture on Redcar

Resources