You are not logged in.

#1 2009-01-03 19:41:43

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

I need some help configuring Vim [SOLVED, but more]

I'm new to Vim and have been searching for days trying to get the editor set up the way that I want it. I'm tired of searching for information, and I know that a bunch of you can answer this question, so here it is:

In Geany I have auto-complete set up in such a way that when I get to the fourth character of a command, the completion menu pops up. This is particularly useful for LaTeX documents in that it's not intrusive, and it helps me to remember commands (I still type them out to commit to memory). Also, Geany is not trying to auto-complete the content of the document, only commands. This is exactly how I want LaTeX set up in Vim. How is this done?

Offline

#2 2009-01-03 19:56:52

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: I need some help configuring Vim [SOLVED, but more]

Dunno about the specific method of autocompletion you're looking for -- standard autocompletion is done with Ctrl-P/Ctrl-N...

For LaTeX I use latex-suite plugin -- it lets me use abbreviations for commonly used latex commands, like "EQE" gets xpanded to this:

\begin{quote}
  
\end{quote}<++>

You can enter the value you want and press Ctrl-j to move the cursor to "<++>" marker and remove the marker.  "FEM" is expanded to \emph{}, "SSE" to "\section{}", etc.  I find that easier and more intuitive than using completion for LaTeX commands, but I appreciate that it all depends on what you're used to...

Offline

#3 2009-01-03 19:58:41

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: I need some help configuring Vim [SOLVED, but more]

Maybe this can help you.
http://vim-latex.sourceforge.net/

Usually vim is extended by scripts. You can find a lot of scripts in the official site.
http://www.vim.org/scripts/index.php


Another important resource are vim tips. They can improve a lot your productivity.
http://vim.wikia.com/wiki/Main_Page

smile

Last edited by ArchArael (2009-01-03 20:00:40)

Offline

#4 2009-01-03 20:01:38

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

fwojciec wrote:

Dunno about the specific method of autocompletion you're looking for -- standard autocompletion is done with Ctrl-P/Ctrl-N...

For LaTeX I use latex-suite plugin -- it lets me use abbreviations for commonly used latex commands, like "EQE" gets xpanded to this:

\begin{quote}
  
\end{quote}<++>

You can enter the value you want and press Ctrl-j to move the cursor to "<++>" marker and remove the marker.  "FEM" is expanded to \emph{}, "SSE" to "\section{}", etc.  I find that easier and more intuitive than using completion for LaTeX commands, but I appreciate that it all depends on what you're used to...

Thanks for the great information.

...but I appreciate that it all depends on what you're used to...

Yeah, I'm pretty locked into the way that I do things. Honestly I just want to spend some time working with Vim to see if it's a good fit for me. Instead, I'm spending far more time configuring Vim.

ArchAreal wrote:

Maybe this can help you.
http://vim-latex.sourceforge.net/

Usually vim is extended by scripts. You can find a lot of scripts in the official site.
http://www.vim.org/scripts/index.php


Another important resource are vim tips. They can improve a lot your productivity.
http://vim.wikia.com/wiki/Main_Page

I've read through parts of all of these. Getting auto-completion set up for Vim is easy enough, getting it to were it useful for me hasn't been.

I do have to say though, Vim has been a hassle to configure so far. Mainly because, like LaTeX, there's many years of history behind it, and websites have a tendency to be what's good for that particular user, not the generic solution.

Offline

#5 2009-01-03 20:06:19

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: I need some help configuring Vim [SOLVED, but more]

skottish wrote:

Instead, I'm spending far more time configuring Vim.

I think that it's normal initially. Being productive in vim requires some time. Almost all vim users never stop to learn vim....it's really a flexible and powerful editor.

You can consider the time you spent as an investment. wink

Sorry for providing you generic information...maybe it will be useful for other users that will read this thread.

Last edited by ArchArael (2009-01-03 20:11:47)

Offline

#6 2009-01-03 20:11:37

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

ArchArael wrote:

Sorry for providing you generic information...maybe it will be useful for other users that will read this thread.

Wait! Generic information is mainly what I'm looking for. My main question is looking for specifics, but all general overview links are awesome. Thank you.

Offline

#7 2009-01-03 20:14:04

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: I need some help configuring Vim [SOLVED, but more]

skottish wrote:
ArchArael wrote:

Sorry for providing you generic information...maybe it will be useful for other users that will read this thread.

Wait! Generic information is mainly what I'm looking for. My main question is looking for specifics, but all general overview links are awesome. Thank you.

Ah...ok!! Then I misunderstood. English is not my mother tongue. I'm still learning it just like vim. wink

Last edited by ArchArael (2009-01-03 20:15:20)

Offline

#8 2009-01-03 20:15:13

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

ArchArael wrote:

Ah...ok!! Then I misunderstood. English is not my mother tongue. I'm still learning just like vim. wink

Congratulations, your English is better than a lot of Americans.

Offline

#9 2009-01-03 20:29:01

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: I need some help configuring Vim [SOLVED, but more]

skottish wrote:
ArchArael wrote:

Ah...ok!! Then I misunderstood. English is not my mother tongue. I'm still learning just like vim. wink

Congratulations, your English is better than a lot of Americans.

Thank you. smile This encourages me.

May I give you one really great tip? I use Ctrl-L instead of Esc. If you want to try this just put these two lines in your .vimrc :

map <C-l> <ESC>
imap <C-l> <ESC>

The first one is for normal mode and the second one permits you to switch from the inserting mode to the normal.

If you don't like Ctrl-l than you can choose some combination that suits you better. Here are some alternatives: http://vim.wikia.com/wiki/Avoid_the_escape_key

I use a similar script for xhtml. Code snippets are very useful to spare a lot of typing and Ctrl-j combination brings me in the right place to complete the code inserted automatically.

Probably the latex script works the same way as the one I use.

Last edited by ArchArael (2009-01-03 20:39:43)

Offline

#10 2009-01-03 20:41:50

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

I like that. The Esc key was something that I was going to look into. I wasn't sure yet if I'd do something like you suggested, or remap the useless Caps Lock key.

Offline

#11 2009-01-03 21:37:50

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

fwojciec and ArchArael, thank you. This thread is very helpful to me. After a long walk I realized that the power of Vim is worth learning to do things a different way. One step closer to total nerdom.

Offline

#12 2009-01-03 21:41:27

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: I need some help configuring Vim [SOLVED, but more]

skottish wrote:

fwojciec and ArchArael, thank you. This thread is very helpful to me. After a long walk I realized that the power of Vim is worth learning to do things a different way. One step closer to total nerdom.

big_smilewink

Last edited by ArchArael (2009-01-03 21:41:58)

Offline

#13 2009-01-03 21:58:16

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: I need some help configuring Vim [SOLVED, but more]

skottish wrote:

One step closer to total nerdom.

Amen, brother.

Offline

#14 2009-01-03 22:00:18

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: I need some help configuring Vim [SOLVED, but more]

I found this thread particularly useful, especially Husio's suggestion. How can you live without the TAB key? tongue


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#15 2009-01-04 07:35:54

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

finferflu wrote:

I found this thread particularly useful, especially Husio's suggestion. How can you live without the TAB key? tongue

fingerflu, that's like the coolest thing ever! Sweet!

Hurray! Whoopy! Yahoo! Yay!

Offline

#16 2009-01-04 19:34:23

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

I want to use 'lbr' line wrapping. I was wondering how to have the line break character at the end of the line and not the beginning. And, can I change the color of the line break character to make it stand out from the rest of the text? My colors a fairly dark and I want that one to be something different. By the way, I'm writing in urxvt and not gVim, so that GTK line break character doesn't apply.

Offline

#17 2009-01-04 20:18:45

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: I need some help configuring Vim [SOLVED, but more]

Oh, I love Vim.
It makes me feel smart...amazing really, for someone as dim as me. wink
Enjoy Vim, skottish!
Also check out the quickstart guide in the wiki article.
Hopefully you find it handy.

Offline

#18 2009-01-04 20:23:29

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

Misfit138 wrote:

Oh, I love Vim.
It makes me feel smart...amazing really, for someone as dim as me. wink
Enjoy Vim, skottish!
Also check out the quickstart guide in the wiki article.
Hopefully you find it handy.

Thanks. Outside of the undocumented vimrc file, it's a really nice tutorial. I stole thayer's vimrc in order to start mine.

Admittedly, I miss how nice Geany is to look at though. Oh, well. Lose one thing, and gain 1,000,000.

Offline

#19 2009-01-04 20:33:05

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: I need some help configuring Vim [SOLVED, but more]

Why don't you use Gvim with a nice theme?


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#20 2009-01-04 20:36:43

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

finferflu wrote:

Why don't you use Gvim with a nice theme?

Once I got fonts looking good in urxvt, gVim didn't make much sense to me. It doesn't seem like it adds much, except for nice line break characters smile. Pretty tabs may be nice too, but I'm not sure that I really need them. vim-bufexplorer and vim-buftabs seems like enough. Am I missing something else?

Offline

#21 2009-01-04 20:59:10

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: I need some help configuring Vim [SOLVED, but more]

Nicer looking fonts, at least for me. I can't stare at terminal fonts, no matter how polished they are, for a long time. I find the GUI fonts to be much more eye-friendly.
Of course gVim has other features, such as buttons and menus, of which I'm not really fond ("set go= " is good for me).


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#22 2009-01-04 21:04:43

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

I did a comparison of fonts when I first started to look at Vim again. I found that with good settings in .Xdefaults, I could get fonts looking very nice in urxvt. But, I haven't sat down and worked on any long(ish) projects yet. Maybe after writing for an hour or so, I'll see things differently. And, I don't use the buttons or the menus anyway, so those are off.

Offline

#23 2009-01-09 08:13:23

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

Yet another round:

***this one found*************************************************
X) I ran into a command the other day that prevented Vim from filling in a starting value when using autocomplete, and I can't find it again. For instance, if I type \sett in LaTeX, then <Ctrl>n, Vim automatically puts \settime in the document when the suggestions list comes up. I don't want anything added unless I explicitly do it. What's the command to stop this?

Command:    set completeopt+=longest  (no help from intuition there)
*****************************************************************

2) Is there a way to set up printing to behave like enscript does? Basically, it's like having lbr enabled in Vim, but wraps without breaking words at the page margins.

3) Is it possible to find an answer to a Vim question using a search engine in less than a day, or am I going to die of old age before I actually get any work done?

Offline

#24 2009-01-09 12:23:45

initbox
Member
Registered: 2008-09-27
Posts: 172

Re: I need some help configuring Vim [SOLVED, but more]

skottish wrote:

3) Is it possible to find an answer to a Vim question using a search engine in less than a day, or am I going to die of old age before I actually get any work done?

http://vim.wikia.com/wiki/Main_Page

Offline

#25 2009-01-09 15:43:39

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I need some help configuring Vim [SOLVED, but more]

initbox wrote:
skottish wrote:

3) Is it possible to find an answer to a Vim question using a search engine in less than a day, or am I going to die of old age before I actually get any work done?

http://vim.wikia.com/wiki/Main_Page

That's a good site. I've already spent quite a few hours there since this thread opened. As I said back in the beginning of all of this, Vim is like LaTeX; Once you start to know the terminology, searching becomes easier.

Offline

Board footer

Powered by FluxBB