www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - vim tips for D development

reply simendsjo <simendsjo gmail.com> writes:
A question for the vim users out there: What plugins etc are you using  
when writing D code?
I'm using the patched ctags, updated d.syntax and snipMate, but are there  
other good plugins I could use?
Feb 19 2012
next sibling parent James Miller <james aatch.net> writes:
I use vim, and I find that just vanilla vim does the job fine for me.
I don't tend to use autocomplete unless its really smart (like using
clang-complete for C/C++), and I should probably grab the latest D
syntax file. mostly just judicious use of "/" and "<number>gg" gets me
most places.
Feb 19 2012
prev sibling next sibling parent "Kiith-Sa" <42 theanswer.com> writes:
On Sunday, 19 February 2012 at 13:37:19 UTC, simendsjo wrote:
 A question for the vim users out there: What plugins etc are 
 you using when writing D code?
 I'm using the patched ctags, updated d.syntax and snipMate, but 
 are there other good plugins I could use?

I use SnipMate with many custom snippets (I can post some if you want, but many are specific to my projects) I also use: ack (better grep) ConqueTerm (terminal inside Vim) supertab (tab completion) session (sessions, duh) autoComplPop (automatically shows completion popup when writing, so you just press Enter to complete) and apparently some other plugins, but I don't remember what those do. Also persistent undo and various other .vimrc settings.
Feb 19 2012
prev sibling next sibling parent simendsjo <simendsjo gmail.com> writes:
On Sun, 19 Feb 2012 17:00:37 +0100, Kiith-Sa <42 theanswer.com> wrote:

 On Sunday, 19 February 2012 at 13:37:19 UTC, simendsjo wrote:
 A question for the vim users out there: What plugins etc are you using  
 when writing D code?
 I'm using the patched ctags, updated d.syntax and snipMate, but are  
 there other good plugins I could use?

I use SnipMate with many custom snippets (I can post some if you want, but many are specific to my projects) I also use: ack (better grep) ConqueTerm (terminal inside Vim) supertab (tab completion) session (sessions, duh) autoComplPop (automatically shows completion popup when writing, so you just press Enter to complete) and apparently some other plugins, but I don't remember what those do. Also persistent undo and various other .vimrc settings.

Thanks. supertab and autoComplPop seems really nice. A couple of other stuff to add to the list: surround, delimitMate and "smart semicolon" in .vimrc: inoremap <leader>; <C-o>A;<cr> It would be great if you could share your snippet file even if it's quite specific for your projects. Would be great even if only serving as an example.
Feb 19 2012
prev sibling next sibling parent "Kiith-Sa" <42 theanswer.com> writes:
On Sunday, 19 February 2012 at 20:09:58 UTC, simendsjo wrote:
 On Sun, 19 Feb 2012 17:00:37 +0100, Kiith-Sa <42 theanswer.com> 
 wrote:


 Thanks. supertab and autoComplPop seems really nice.

 A couple of other stuff to add to the list:
 surround, delimitMate
 and "smart semicolon" in .vimrc: inoremap <leader>; <C-o>A;<cr>

 It would be great if you could share your snippet file even if 
 it's quite specific for your projects. Would be great even if 
 only serving as an example.

I removed project-specific stuff and uploaded it to GitHub: https://github.com/kiith-sa/D-SnipMate
Feb 19 2012
prev sibling parent simendsjo <simendsjo gmail.com> writes:
On Sun, 19 Feb 2012 23:02:21 +0100, Kiith-Sa <42 theanswer.com> wrote:

 On Sunday, 19 February 2012 at 20:09:58 UTC, simendsjo wrote:
 On Sun, 19 Feb 2012 17:00:37 +0100, Kiith-Sa <42 theanswer.com> wrote:


 Thanks. supertab and autoComplPop seems really nice.

 A couple of other stuff to add to the list:
 surround, delimitMate
 and "smart semicolon" in .vimrc: inoremap <leader>; <C-o>A;<cr>

 It would be great if you could share your snippet file even if it's  
 quite specific for your projects. Would be great even if only serving  
 as an example.

I removed project-specific stuff and uploaded it to GitHub: https://github.com/kiith-sa/D-SnipMate

Thanks! I see we have added much of the same stuff. I was hoping you had found a way to avoid all the duplication, which I see you haven't unfortunally. I have stuff like the following in my file. absolutely horrible duplication # TRY/CATCH/FINALLY snippet tn throw new ${1}Exception(${2:"error"}); ${3} snippet try try { ${1:static assert(false);} } snippet catch catch(${1}Exception ${2:ex}) { ${3:static assert(false, "$1Exception not handled");} } snippet finally finally { ${1:static assert(false, "finally not implemented.");} } snippet tc try ${1:static assert(false)}; catch(${2}Exception ${3:ex}) ${4:static assert(false)}; ${5} snippet tcb try { ${1:static assert(false);} } catch(${2}Exception ${3:ex}) { ${4:static assert(false);} } ${5} snippet tf try ${1:static assert(false)}; finally ${2:static assert(false)}; ${3} snippet tcf try ${1:static assert(false)}; catch(${2}Exception ${3:ex}) ${4:static assert(false)}; finally ${5:static assert(false)}; ${6} snippet tcfb try { ${1:static assert(false);} } catch(${2}Exception ${3:ex}) { ${4:static assert(false);} } finally { ${5:static assert(false);} }
Feb 20 2012