DATA Step, Macro, Functions and more

[Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Reply
Occasional Contributor
Posts: 19

[Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

 

I suggest that VIM keybindings are implemented in the SAS interactive development environments (like SAS base and SAS EG). 

 

VIM is great because it can make you a vastly more productive programmer. 

 

Here is an example of what it can do:

https://jaxbot.me/articles/why-i-use-vim

 

The following IDEs already have implemented optional VIM functionality (why not do the same in SAS):

Microsoft Visual Studio

Microsoft SQL Management Studio 

The Rstudio ( using this open source ressource http://ace.c9.io/#nav=about

The Pycharm IDE for Python

Sublime Text (general editor)

 

VIM modes for Chrome browser and Firefox also exists. 

 

 

PS

If this is not the place for feature suggestions I would appreciate a link in the right direction. If no place for feature suggestions exist i suggest that one is created. 

 

 

PROC Star
Posts: 1,760

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Posted in reply to rasmuslarsen

Suggestions should be posted in "SAS Software ballot ideas."

Occasional Contributor
Posts: 19

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Thanks, I will move the post Smiley Happy
Occasional Contributor
Posts: 19

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Wait, I cant find "Software Ballot Ideas" where is it? Smiley Happy

Super User
Super User
Posts: 7,953

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Posted in reply to rasmuslarsen

Is this not covered by Abbreviations.  If you goto Tools->Add Abbreviation, you can type in a short phrase, say #sql, and this can be expanded directly to:

proc sql;

   create table ... as

   select   

   from 

   where

;

quit;

 

Don't get me wrong though, the "Enhanced Editor" really does need replacing with any one of the numerous editors out there.

Occasional Contributor
Posts: 19

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

[ Edited ]

The abbreviations is only a tiny part of what VIM can do, eg. the whole modal editing perspective.

 

 

Here is an answer on stackoverflow which explains more:  http://stackoverflow.com/a/1220118/1831980

Super User
Posts: 11,343

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Posted in reply to rasmuslarsen

If I were pushing for a specific editor my particular choice would be the old IBM "Enhanced Programming Editor" that shipped with OS/2.

 

Stubs of code are minor compared to an editor macro that is flexible enough to play and win games of tic-tac-toe and do random selections from lists.

Occasional Contributor
Posts: 19

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

[ Edited ]

VIM is much more than stubs of code Smiley Happy

 

Here is an answer on stackoverflow which explains more:  http://stackoverflow.com/a/1220118/1831980

Occasional Contributor
Posts: 19

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

You can do that in Vim as well. Here are examples games created using only Vim. Of course this is only for fun, but shows the power of Vim.

 
Arkanoid
Snake:
Tetris:
And of course do all sorts of selection. E.g. random or weighted random:

 

TeTrIs.vim [1] is a Vimscript and quite a nice one, even though there is nothing fancy about the gameplay except the Rotating Mode, it lets you play the game. The script was written almost fourteen years ago, and it's still working well in recent Vim for the Traditional Mode. The Rotating Mode ...
Respected Advisor
Posts: 4,173

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Posted in reply to rasmuslarsen

@rasmuslarsen

Just curious: When Googling SAS VIM there are hits. It's not official SAS released but have you tried any of these? And if yes: Anything working and adding value?

Occasional Contributor
Posts: 19

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

 

 

Some of the implementations are either syntax highlighting, code completetion or indentation, which is nice but they cannot run SAS code.

However, other implementations can run SAS code, but as far as I can see only in batch mode (I hope I'm wrong):

 

http://jiangtanghu.com/blog/2011/11/13/vim-as-a-sas-ide/

http://www-personal.umich.edu/~knassen/vim/sasfns.html#loadsaslog (unix mostly)

https://atom.io/packages/language-sas

 

Regular Contributor
Posts: 233

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Posted in reply to rasmuslarsen

Hello,

 

https://communities.sas.com/t5/SASware-Ballot-Ideas/Edit-programs-in-an-external-editor/idi-p/220352

 

It seems that SAS EG, since release 7.12, allows to open a program in an external editor. From what I understand, you cannot

run the program from Vim but saved changes will prompt the same program opened in EG for reload.

Super Contributor
Posts: 439

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

A SAS program is just a text file so you can edit it in any text editor - my personal favourite is UltraEdit but each to their own (except I've never seen the attraction of vi - "It'll be nice when it's finished" has always been my reaction to it's arcane syntax...)

Occasional Contributor
Posts: 19

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Posted in reply to ChrisBrooks

This discussion is about how to run SAS-code using Vim (or possibly Vim emulation in SAS Legacy), not just edit. 

Ultraedit looks great! And, yes, learning Vim syntax takes some time, but it is well worth it Smiley Happy  

Here is a great explanation of Vim syntax:

https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1...

Occasional Contributor
Posts: 19

Re: [Feature suggestion] Implement VIM in the SAS base and SAS Enterprise Guide

Thanks! This could be a good workaround Smiley Happy
Ask a Question
Discussion stats
  • 15 replies
  • 386 views
  • 1 like
  • 7 in conversation