newLISP Fan Club

Forum => newLISP newS => Topic started by: Cyril on June 12, 2009, 11:28:59 AM

Title: newlisp.vim version 1.27
Post by: Cyril on June 12, 2009, 11:28:59 AM
I've updated the newlisp.vim syntax highlighting file. In this version:



* new built-in functions introduced recently into newlisp: last-error, xfer-event and inf? (the version shipped with newlisp already has these);



* module function (technically, not built-in but preloaded, but worth highlighting nevertheless);



* custom tags for newlispdoc are highlighted (but not the same way as standard ones, to make catching typos easy);



This release is numbered 1.27, because Lutz has used 1.26 for his patched version. I believe it is ready for newlisp v10.1. Downloadable from the usual locations (one (//http), two (//http)).
Title:
Post by: ale870 on July 05, 2009, 02:45:48 AM
I frequentryl use vim, but I'm not an expert, so can you give me some hints (a small quickstart guide!) how to include this syntax hightlight extension in VIM?



Thank you!
Title:
Post by: Cyril on July 05, 2009, 04:02:36 AM
I assume that you have highlighting already enabled for other languages (if not, read :help usr_06 before). Then copy newlisp.vim file into syntax directory, located in some directory listed in runtimepath. Depending on your access rights and intentions, this can be system-wide or your personal setting. Examples:



C:Program FilesVimvimfilessyntaxnewlisp.vim

/home/slobin/.vim/syntax/newlisp.vim



Guess which OS is which. ;-) Appropriate directories should be created if necessary. Then your need teach vim which files are written in newlisp. For example, I use .lsp extension exclusively for newlisp (I don't use Common Lisp or others), but your mileage may vary. So I have the folloving line in my .vimrc:



autocmd! filetypedetect BufNewFile,BufRead *.lsp set filetype=newlisp



You should set something similar according to your taste. That's all.



Update: typo in file path for Windows fixed.
Title:
Post by: ale870 on July 05, 2009, 04:23:34 AM
I'm sorry, but I have another boring question: where is ".vimrc"?

I cannot find it! I used "locate .vimrc" (my db is updated).



I only found "vimrc" (without dot).



Thank you again!
Title:
Post by: Cyril on July 05, 2009, 04:40:42 AM
In brief: vimrc is system-wide, .vimrc is your personal. If you haven't yet, just create it in your home directory. In full: vim starting is a very complex process, with lot of nice features if only you are ready to learn them all. Read :help starting, but prepare to be really bored.



P.S. Vim allows a lot of customization: e.g. my pet .vimrc has 479 lines now. ;-) (It is here (//http) if you are curious).
Title:
Post by: ale870 on July 05, 2009, 05:33:03 AM
Ok it worked! I even put "syntax enable" in my vimrc file ;-)



I will change color for comments (blue) since it is a little bit too dark.



It seems you are an expert using vim, so I want to make you a question (not... two questions):



1) Why do you use vim and not use emacs?

2) I suggest you to make some "lessons" to configure vim, since I found a lot of documentation on it, but they are always "manuals" (one must read them from the first page to the end, and I haven't so much time). Instead, if you make small lessons (plus some tricks) I think they could be appreciated so much from the new users.



Thank you!
Title:
Post by: Tim Johnson on July 05, 2009, 06:33:01 PM
Quote
1) Why do you use vim and not use emacs?

I have used both and done a lot of script writing for both, including a emacs mode

for newlisp.

I started out using emacs for newlisp. I really like the comint mode that allows one

to run the newlisp binary and REPL inside of emacs. You can both evaluate code

in a newlisp file or test code in the newlisp interpreter using emacs keymapping.

This is a great feature, however, I switched to vim for newlisp for the same reasons

as the other scripting languages that I use:



1)Vim handles multiple syntax highlighting where one mixes css,html and javascript in

the same file, and although that doesn't apply directly to newlisp directly, it means that

I adapt to one editor, rather than two. Also:

2)Vim interacts with other *nix tools I use like lynx, slrn, and (most of all) MC.



I am thankful for Cyril's newlisp.vim. Thanks!

Since it sounds like ale870 is using an *nix system, I would urge you to learn about

the local .vim directory and its various subdirectories.

cheers

tim
Title:
Post by: ale870 on July 05, 2009, 11:03:40 PM
Thank you for your info!

I used windows for... a life (about 20 years!), but now I definitively switched to Linux. I use Linux mint over my PC (at home and at work), and I use CrunchBang Linux over my notebook and in another netbook (acer aspire one). I definitively "fired" all my windows installations ;-)

Now I use gedit (it works very well, even because it has a nice plugin feature).

But in my job I frequently use ssh to connect on remote servers (I maintain about 8 servers in different configurations), so I use vim :-)



I never used vim "seriously" (only basic features), but I was asking to myself (and to other guys!) if it will be good to switch from gedit (linux only, and tightly linked to GUI environment) to vim.

I'm an "old" programmer (I made my first app about... 27 years ago!) and I feel comfortable to work with keyboard.

(furthermore vim works even in windows...).



So I'm evaluating to spend some time to learn it.
Title:
Post by: Tim Johnson on July 07, 2009, 02:59:06 PM
If you like using the keyboard, vim is the one for you. Given that the "modal" style

of editing is not to strange for you. Once you get used to it, it makes a huge amount

of sense. I've also use xmodmap to remap my keyboard for a better fit with both

vim and emacs-style keyboard shortcuts.



I.E. CTRL is next to the 'A' key, ESC is above it, TAB is to the right of the space-bar,

(since CTRL-I is TAB in many instances).

And of course, MC, Slrn, lynx, and mutt make use of either (or both) styles.

:) And I use a newlisp app for synchronizing the desktop testing and development environment with remote servers.....