Vim bash syntax wrong?
Vim is wrongly highlighting the closing parenthesis in my shell scripting files.
In other words, it looks like the syntax is wrong (maybe it is).
A picture would illustrate better.
http://imageshack.us/photo/my-images/56 … error.png/
I only have the default sh.vim that comes with gvim 7.3 default
package in arch. Nothing in ~/.vim/syntax or ~/.vim/after/syntax.
Could someone verify if the same happens in your systems. The system
is fully up to date.
Thanks in advance.
Last edited by FernandoBasso (2011-12-20 19:57:39)
Procyon wrote:
egan wrote:
I've noticed various syntax coloring errors in bash scripts lately.
One of the main ones is that the closing parenthesis of an array is highlighted red, e.g.:
SUBRANGE=(${RANGE[@]})
Another consistent problem is the coloring of file descriptors.
In my first function, the string >&2 is colored completely yellow, but in subsequent functions the same string has a magenta 2.
Furthermore, some string redirects are colored wrong, the final tac being off-colored, e.g.:
if $(grep -q "[^[:digit:]:-]" <<< "$1")
There are often errors in quote delimiting too, e.g. after the following line, the entire file is colored as if it is a string literal:
if $(amixer | grep -A 4 \'$SDEVICE\' | awk {'print $6'} | grep -q "\[off\]")
Also, process substitution looks funny in that the tic is a different color than the parentheses, though that's not specifically incorrect.
I guess the moral of the story is I should try to fix this.
These all work if you use a bash syntax file instead of sh.
I have
let g:is_bash=1
in my vimrc already.
Similar Messages
-
[Workaround] Weird vim bash completion behaviour
Currently running bash-completion 1.2-2. Vim does not seems to auto-complete files when I am in the root of my home directory(i.e. just '~' and no subdirectories); only sub-directories are given as possible options. Resourcing /etc/bash_completion does not have any effect. Other current working directories work fine. Running this line from /etc/bash_completion does seem to fix it:
complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
Resourcing /etc/bash_completion breaks it again, really weird.
I have no idea what's going on. Maybe bash-completion has trouble with the '~' character somehow?
EDIT: only the root of the user's home directory is affected (i.e. just '~' and no subdirectories)
Last edited by OutOfPhase (2011-03-24 16:02:41)Seems that some completion rules are being deleted in the lines 1632-1653 in /etc/bash_completion, which is the very file that adds the completion rules in the first place(!) This hardly makes any sense. Somewhere in that block things go wrong.
Commenting crucial lines from this block, for example line 1644, fixes it. -
[self-SOLVED]vim + lilypond syntax highlighting
I'm trying to get vim to use syntax highlighting in lilypond files. Apparently lilypond comes with the necessary files, but I have not been able to make vim find them (?). I am not very experienced with vi(m), so there might be something wrong with my setup.
I have, of course, both vim and lilypond installed. The files for lilypond syntax highlighting are in subdirectories of /usr/share/lilypond/2.12.3/vim/. Vim syntax highlighting works for other files, such as C++, HTML, etc., so no problem there. My ~/.vimrc file contains
set runtimepath+=/usr/share/lilypond/2.12.3/vim/
as per instruction given in http://lilypond.org/doc/v2.12/Documenta … m/Vim-mode (and the path is correctly modified). But when I open a lilypond file (with the correct .ly suffix) all I get is black and white. What's the problem?
[EDIT: Oh heck, nevermind! Apparently I was getting too tired to read instructions properly. Was missing the ~/.vim/filetype.vim file described in the above link.]
Last edited by lotuskip (2010-04-12 18:33:42)You're right about it being overridden. This change should be able to be placed in ~/.vimrc though.
Well that was foolish - I should have read the comments right below in that file. It says exactly how to set it in vimrc. I've now added the following to my ~/.vimrc and this is completely solved without modifying the /usr/... file.
let g:tex_flavor = "tex"
Last edited by Trilby (2013-03-29 16:11:26) -
[SOLVED] VIM: different syntax highlighting for new vs existing file
I've had this minor nagging issue for a while that I've been trying to figure out, but I just don't know where to look.
It is most obvious with LaTeX files (*.tex). When I create a new file with "vim file.tex" it is recognized as a latex file and I get syntax highlighting, but it seems odd, or off. When I close then reopen the same file, it gets "propper" syntax highlighting.
I gather that this must be because of the two different mechanisms for matching the syntax type: filename versus content. When the file is new, vim only uses the extension. Once there is a latex comand (e.g., "\documentclass{article}") it recognizes it as something else and the highlighting style is different.
It turns out just by actually elaborating exactly what the problem was, I was able to find the solution. I looked for how vim recognizes the files, and found two relevant lines in /usr/share/vim/vim73/filetype.vim on lines 2093 and 2094. Apparently the .tex filetype is not the same as .latex and others. I changed it so it was, and I got the desired behavior.
I thought about just not posting this - but it may be useful for others.You're right about it being overridden. This change should be able to be placed in ~/.vimrc though.
Well that was foolish - I should have read the comments right below in that file. It says exactly how to set it in vimrc. I've now added the following to my ~/.vimrc and this is completely solved without modifying the /usr/... file.
let g:tex_flavor = "tex"
Last edited by Trilby (2013-03-29 16:11:26) -
I'm trying to create a vim syntax file for writing. I'm detecting matching quote marks so I change the color of quotes, and I'm also detecting plain text stylings like /italics/ and *bold* to modify the style accordingly. However, I can't seem to combine them.
For example:
black black black "green green green" black black.
black black black *bold-black* black
black black black "green green green *bold-black* green" black.
Is there a way for vim to preserve the color of the containing element but modify the style (or vice versa)?
Thanks.Hi,
$ echo $TERM
xterm
And
:set ft
filetype=php
:set syntax
syntax=php
Using aterm does work! But is there any option to enable colors under xterm?
thanks
phrakture wrote:
Before you enter vim, what is the output of "echo $TERM".
When inside vim, what is the output ":set ft" and ":set syntax"? -
Use gvim to edit text areas and get it to use javascript.vim syntax file
I have had a lot of trouble with javascript and editting files via apex's "javascript" sections in the page.
The font in firefox did not distinguish various braces well enough for me. I kept accidentally mixing curly braces and parens... And I would now and then put the plsql concatenate operator || instead of the javascript +. Bleah! There are SO many ways to completely break javascript. And the whole javascript herd goes down when just one little function anywhere in there has an errant brace or quote. So I started resenting not using my customary text editor gvim. I have to have this stuff colorized and have showmatch turned on!
So anyway I found that you can edit textareas with gvim, I don't know if this is commonly known or not so
I thought I'd mention it. Or you can use whatever editor you want.
I only tried this on windows but theoretically it works on other operating systems modulo you
adjusting the shell details appropriately.
First of all install the"It's all text!' firefox extension and restart firefox.
then create a batch file something like this:
(NB: don't call a batch file the same name as an executable. That can cause pesky loops :-)
gvimrun.bat:
c:\vim\vim73\gvim.exe %1 -c "set filetype=javascript"
Note the pathname to gvim.exe needs to be customized. Note the parameter for passing the first argument along. (%1) The set filetype is telling it effectively to use the c:\vim\vim73\syntax\javascript.vim file.
so then when you bring up your page in apex , when you put the mouse cursor right below the
down arrow of the vertical scrollbar on the rhs of the textarea, you should see a little blue button
that says "edit". Then right click and choose preferences. Direct it to your batch file.
And if all is well it will work and invoke gvim with syntax coloring. Which makes it just a tiny bit less likely to really flub it.
Now if anyone else wants to pick up the baton and figure out how to get more than one syntax
in effect such as javascript and jquery? I did find a jquery.vim file out there. ...
Now that we know how to do this if someone knows some really super great javascript /jquery
editor that might be way better than gvim I would definitely consider that! Javascript is easy to screw up
Edited by: lake on Jan 2, 2011 11:34 AMHi Mathan. Here is something i have trying to do. This vi does not write it correct... and have I done something wrongly or "stupidly" in code
Problems:
-Second row is inroccet
-If i know that device returns array where is 10 elements. Can I trust that and just return 10 elements from array and changed it to string?
-Can I trust queue in this way?
I think hardest in labview coding is that you dont know what kind component you should use and what is the right way to use them.
Attachments:
array to file.vi 21 KB -
[Solved][VIM] E484: Can't open file syntax.vim
Hi all,
I've installed Archlinux few days ago on my netbook and yesterday i decided to configure Vim using plugins.
During plugins configuration, i messed up and i decided to revome all Vim files in my ~ folder in order to restart configuration.
However, since I've executed the `rm -R .vim .vimrc .viminfo` command, I can't re-activate Vim's syntax coloration using `syntax on` into my .vimrc file nor into Vim directly.
Here is the error message when I start Vim :
Error detected while processing /home/romain/.vimrc:
line 1:
E484: Can't open file /home/romain/.vim/syntax/syntax.vim
Press ENTER or type command to continue
I've found this topic on BBS which seems to be the same problem as me but reinstalling vim or vi doesn't solve this problem.
I've tried to copy this syntax.vim file from /usr/share/vim/vim73/syntax/syntax.vim but it doesn't solve the problem and I want a clean solution without hacking my ~ folder ; moreover, this bug also appears being root while I haven't configured vim with the root account so it may be a problem into Vim's installation folders or something.
Thanks for your help and sorry I my english contains mistakes,
MicroJoe.
Last edited by MicroJoe (2012-06-14 16:16:45)This is the output :
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 7 2012 00:41:40)
Rustines incluses : 1-547
Compilé par ArchLinux
Grosse version sans interface graphique.
Fonctionnalités incluses (+) ou non (-) :
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
+mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
+mouse_xterm +mouse_urxvt +multi_byte +multi_lang -mzscheme -netbeans_intg
+path_extra +perl +persistent_undo +postscript +printer -profile -python
-python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
fichier vimrc système : "/etc/vimrc"
fichier vimrc utilisateur : "$HOME/.vimrc"
fichier exrc utilisateur : "$HOME/.exrc"
$VIM par défaut : "/usr/share/vim"
Compilation : gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/local/include -march=i686 -mtune=generic -pipe -fstack-protector --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Édition de liens : gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -L/usr/local/lib -Wl,--as-needed -o vim -lm -lncurses -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -fstack-protector -L/usr/local/lib -L/usr/lib/perl5/core_perl/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
(I've noticed that some part were in French but I hope that it'll not be a problem). -
Can't open file syntax.vim
I have vim installed from extra (x86_64). When I start vim I get the following error:
$ vim
Error detected while processing /etc/vimrc:
line 41:
E484: Can't open file /usr/share/vim/vimcurrent/syntax/syntax.vim
Error detected while processing /home/nsmoot/.vimrc:
line 63:
E484: Can't open file /usr/share/vim/vimcurrent/syntax/syntax.vim
Press ENTER or type command to continue
There is not a "current" directory on my system...
# find / -name "syntax.vim" -print
/usr/share/vim/syntax/syntax.vimI had this problem, but the culprit was mercurial for me.
If you're getting the vim72 error check what's in that directory.
The only file in there for me was..
# ls /usr/share/vim/vim72/syntax/
HGAnnotate.vim
# pacman -Qo /usr/share/vim/vim72/syntax/HGAnnotate.vim
/usr/share/vim/vim72/syntax/HGAnnotate.vim is owned by mercurial 1.3-1
I tested it first by moving vim72 to vim72.bak and the problem went away, after that I uninstalled mercurial (I never use it)
Here's the loading order according to the vim documentation:
You don't normally set $VIMRUNTIME yourself, but let Vim figure it out. This
is the order used to find the value of $VIMRUNTIME:
1. If the environment variable $VIMRUNTIME is set, it is used. You can use
this when the runtime files are in an unusual location.
2. If "$VIM/vim{version}" exists, it is used. {version} is the version
number of Vim, without any '-' or '.'. For example: "$VIM/vim54". This is
the normal value for $VIMRUNTIME.
3. If "$VIM/runtime" exists, it is used.
4. The value of $VIM is used. This is for backwards compatibility with older
versions.
5. When the 'helpfile' option is set and doesn't contain a '$', its value is
used, with "doc/help.txt" removed from the end.
source: http://www.vim.org/htmldoc/starting.html#$VIMRUNTIME
It was loading #2 for me, removing vim72 directory means it loads #4. (skips #3 since I don't have a /usr/share/vim/runtime dir) -
Emacs and vim syntax colorization
Does anybody use an emacs or vim syntax colorization .el file for editing PKGBUILD files?
rafal wrote:Yes, I meant both ot them:)
I have found the emacs PKGBUILD mode here:
http://www.hoetzel.info/Hacking/emacs/pkgbuild-mode.el
and where I can find the vim mode?
for vim
set syntax=sh
a PKGBUILD is just a shell script
rafal wrote:
[Off topic]
By the way I'm at the stage of trying different editors and I have not decided yet. For now it's easier to write in emacs because i'm not get used to first write and then correct as vim forces me. And you, how do you use vim editor? First writing in insert mode and then correcting the text in command mode? Does it depend on the touch type skills and type errors number?
Thanks for help.
check here: http://bbs.archlinux.org/viewtopic.php?t=11988 -
Tweak vims syntax highlighting
here is a little tutorial for making your own s-h theme for vim,
if you're using gvim you can skip the part about terminals,
for terminal users you must first set your prefered terminal colours in .Xdefaults ,
eg for urxvt:
urxvt*scrollColor: #111111
urxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=13
urxvt*scrollBar_floating: false
urxvt*scrollstyle: urxvt
urxvt*saveLines: 1000
urxvt*foreground: #eeeeee
urxvt*background: #000000
! black
urxvt*color0: #000000
urxvt*color8: #444444
! red
urxvt*color1: #b21818
urxvt*color9: #ee9090
! green
urxvt*color2: #18b218
urxvt*color10: #54ee54
! yellow
urxvt*color3: #968a38
urxvt*color11: #eeee77
! blue
urxvt*color4: #1818b2
urxvt*color12: #9090ee
! magenta
urxvt*color5: #963c59
urxvt*color13: #cf9ebe
! cyan
urxvt*color6: #418179
urxvt*color14: #71bebe
! white
urxvt*color7: #aaaaaa
urxvt*color15: #eeeeee
then you save this example file as ~/.vim/colors/xerxes.vim
" local syntax file - set colors on a per-machine basis:
hi clear
set background=dark
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "xerxes"
hi Normal guifg=white guibg=black
hi Scrollbar guifg=darkcyan guibg=cyan
hi Menu guifg=black guibg=cyan
hi SpecialKey term=bold cterm=bold ctermfg=2 guifg=Blue
hi NonText term=bold cterm=bold ctermfg=darkred gui=bold guifg=Blue
hi Directory term=bold cterm=bold ctermfg=brown guifg=Blue
hi ErrorMsg term=standout cterm=bold ctermfg=grey ctermbg=blue guifg=White guibg=Red
hi Search term=reverse ctermfg=white ctermbg=red guifg=white guibg=Red
hi MoreMsg term=bold cterm=bold ctermfg=darkgreen gui=bold guifg=SeaGreen
hi ModeMsg term=bold cterm=bold gui=bold guifg=White guibg=Blue
hi LineNr term=underline cterm=bold ctermfg=darkcyan guifg=Yellow
hi Question term=standout cterm=bold ctermfg=darkgreen gui=bold guifg=Green
hi StatusLine term=bold,reverse cterm=bold ctermfg=4 ctermbg=15 gui=bold guifg=blue guibg=white
hi StatusLineNC term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue
hi Title term=bold cterm=bold ctermfg=darkmagenta gui=bold guifg=Magenta
hi Visual term=reverse cterm=reverse gui=reverse
hi WarningMsg term=standout cterm=bold ctermfg=red guifg=Red
hi Cursor guifg=bg guibg=Green
hi Comment term=bold ctermfg=6 guifg=#80a0ff
hi Constant term=underline ctermfg=9 guifg=#ffa0a0
hi Special term=bold ctermfg=1 guifg=Orange
hi Identifier term=underline ctermfg=14 guifg=#40ffff
hi Statement term=bold cterm=bold ctermfg=11 gui=bold guifg=#ffff60
hi PreProc term=underline ctermfg=5 guifg=#ff80ff
hi Type term=underline cterm=bold ctermfg=lightgreen gui=bold guifg=#60ff60
hi Error term=reverse ctermfg=darkcyan ctermbg=black guifg=Red guibg=Black
hi Todo term=standout ctermfg=black ctermbg=darkcyan guifg=Blue guibg=Yellow
hi link IncSearch Visual
hi link String Constant
hi link Character Constant
hi link Number Constant
hi link Boolean Constant
hi link Float Number
hi link Function Identifier
hi link Conditional Statement
hi link Repeat Statement
hi link Label Statement
hi link Operator Statement
hi link Keyword Statement
hi link Exception Statement
hi link Include PreProc
hi link Define PreProc
hi link Macro PreProc
hi link PreCondit PreProc
hi link StorageClass Type
hi link Structure Type
hi link Typedef Type
hi link Tag Special
hi link SpecialChar Special
hi link Delimiter Special
hi link SpecialComment Special
hi link Debug Special
now you can start tweaking the theme, use the numbers in .Xdefaults as your prefered colours in the "ctermfg" and "ctermbg" commands,
now you can use the "colorscheme" command in vim to enable it,
colorscheme xerxeshello iphitus,
i've edited the first post and if you use that .Xdefaults the following scheme should give you something close to desert,
" Vim color file
set background=dark
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
hi clear
if exists("syntax_on")
syntax reset
endif
endif
let g:colors_name="desert"
hi Normal guifg=White guibg=grey20
" highlight groups
hi Cursor guibg=khaki guifg=slategrey
"hi CursorIM
"hi Directory
"hi DiffAdd
"hi DiffChange
"hi DiffDelete
"hi DiffText
"hi ErrorMsg
hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none
hi Folded guibg=grey30 guifg=gold
hi FoldColumn guibg=grey30 guifg=tan
hi IncSearch guifg=slategrey guibg=khaki
"hi LineNr
hi ModeMsg guifg=goldenrod
hi MoreMsg guifg=SeaGreen
hi NonText guifg=LightBlue guibg=grey30
hi Question guifg=springgreen
hi Search guibg=peru guifg=wheat
hi SpecialKey guifg=yellowgreen
hi StatusLine guibg=#c2bfa5 guifg=black gui=none
hi StatusLineNC guibg=#c2bfa5 guifg=grey50 gui=none
hi Title guifg=indianred
hi Visual gui=none guifg=khaki guibg=olivedrab
"hi VisualNOS
hi WarningMsg guifg=salmon
"hi WildMenu
"hi Menu
"hi Scrollbar
"hi Tooltip
" syntax highlighting groups
hi Comment guifg=SkyBlue
hi Constant guifg=#ffa0a0
hi Identifier guifg=palegreen
hi Statement guifg=khaki
hi PreProc guifg=indianred
hi Type guifg=darkkhaki
hi Special guifg=navajowhite
"hi Underlined
hi Ignore guifg=grey40
"hi Error
hi Todo guifg=orangered guibg=yellow2
" color terminal definitions
hi SpecialKey ctermfg=darkgreen
hi NonText cterm=bold ctermfg=darkblue
hi Directory ctermfg=darkcyan
hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1
hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green
hi Search cterm=NONE ctermfg=grey ctermbg=blue
hi MoreMsg ctermfg=darkgreen
hi ModeMsg cterm=NONE ctermfg=brown
hi LineNr ctermfg=3
hi Question ctermfg=green
hi StatusLine cterm=bold,reverse
hi StatusLineNC cterm=reverse
hi VertSplit cterm=reverse
hi Title ctermfg=5
hi Visual cterm=reverse
hi VisualNOS cterm=bold,underline
hi WarningMsg ctermfg=1
hi WildMenu ctermfg=0 ctermbg=3
hi Folded ctermfg=darkgrey ctermbg=NONE
hi FoldColumn ctermfg=darkgrey ctermbg=NONE
hi DiffAdd ctermbg=4
hi DiffChange ctermbg=5
hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
hi DiffText cterm=bold ctermbg=1
hi Comment ctermfg=12
hi Constant ctermfg=9
hi Special ctermfg=5
hi Identifier ctermfg=10
hi Statement cterm=bold ctermfg=11
hi PreProc ctermfg=1
hi Type ctermfg=2
hi Underlined cterm=underline ctermfg=5
hi Ignore cterm=bold ctermfg=7
hi Ignore ctermfg=darkgrey
hi Error cterm=bold ctermfg=7 ctermbg=1 -
Vim, Perl and syntax highlight
Hello all,
Suppose you have a little snippet of Perl code like such:
sub foo # some comment with keywords for die and or not
print "In sub foo!\n";
The comment in the sub line is not treated (i.e. highlighted) as a comment. Rather, it is highlighted as regular source code. Seems like a bug, but before reporting it to the maintainer, I wanted to see if anyone else shared the same issue.
To clarify: this refers only to highlight in vim, running the code works as expected. And I took care to see if this could be the results of my settings: the problem seems in fact, to be with the perl.vim file (in my system: /usr/share/vim/vim73/syntax/perl.vim).
So, can anyone reproduce this behaviour?frabjous wrote:Yes, same for me. (I don't write perl, so I don't have anything special installed for it other than the default /usr/share/vim73/syntax/perl.vim.)
Hum, ok. I'll report it to the maintainer then. -
Hi all,
with the recent vim upgrade I have notified a couple of package maintainers that they would have to move some vim support files that are in their packages (e.g. syntax highlighting) out of /usr/share/vim/syntax and similar into subdirectories. However, I'm afraid I might have suggested something wrong there: My suggestion was that they be put in /usr/share/vim/vimfiles/syntax and so on, but Pierre has already updated his cmake package (bugreport) and moved it into /usr/share/vim/vim72/syntax etc.
Since I've also seen similar discussions at least in the latexsuite package (now removed since the packages have been renamed), and so I wonder what is the difference resp. the Archlinux policy with regard to those two directories: /usr/share/vim/vim72 vs. /usr/share/vim/vimfiles. (Personally, I thought that the vim72 subdirectory is for the distribution of vim itself, whereas distribution-specific stuff would go to the vimfiles subdirectory. - That's where the latex-suite package's files are now, too.)
Anyone with more sound reasoning or an insight into some quasi-"official" view on the question?
TIA,
AndreasActually the bug report asked to move from /usr/share/vim to /usr/share/vim/vimfiles
So I am confused..
Edit : ok I see now : http://repos.archlinux.org/viewvc.cgi/c … 3&r2=52345
Pierre moved from /usr/share/vim to /usr/share/vim/vim72 instead.
Last edited by shining (2009-10-08 11:13:01) -
[solved] confusion about vim and its config files
Hi, Im getting really confused with vim and its /etc/vimrc config, and the per user ~/.vimrc.
On one of my PC's I have an untouched /etc/vimrc and a /home/jason/.vimrc which has:
syntax on
now, on that same PC, if I run
vim .vimrc
"syntax on" in green and yellow as expected, and if I run
sudo vim .vimrc
I also see
"syntax on" in green and yellow, but surely this is opening it as root?
*Edit
Even though there is no .vimrc in /root, and the system-wide /etc/vimrc is untouched/blank
On another PC I also have an untoched /etc/vimrc, and a /home/jason/.vimrc which has:
syntax on
Aswell, and:
vim .vimrc
has "syntax on" in green and yellow as expected, but this time:
sudo vim .vimrc
Has no colour?
I cant explain this, any ideas?
*Edit
To clarify, both PC's have an untouched /etc/vimrc and there is no /root/.vimrc file on either PC
Last edited by jrussell (2013-04-14 10:21:42)siriusb wrote:
The configuration files in /etc are for system-wide settings. These are the default settings if not overridden by a user's own settings in their home directory.
So running vim as your regular user will use the settings from your home directory.
What does sudo? From man sudo
sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.
So if you didn't specify any setting in the home folder of the user you want to run vim as, and you don't have anything in /etc/vimrc, vim won't apply any custom settings.
I understand all of that, but on both my PC's I have a clean/untouched config /etc/vimrc, and both /root/.vimrc files do not exist, so howcome on one PC I get colour with sudo vim...., and on the other I dont? -
Vim Ctrl + Tab for Tabs navigation
:noremap <silent> <c-Tab> :tabn<CR>
noremap! <silent> <C-Tab> :tabn<CR>
This doesn't work for me - any idea why? Ctrl-tab just doesn't shift tabs... I've definitely not bound the combination elsewhere in my .vimrc either.
- KD
Last edited by KomodoDave (2007-05-02 02:38:33)mosor wrote:
Here are my tab related settings (that work):
set showtabline=2 " File tabs allways visible
:nmap <C-S-tab> :tabprevious<cr>
:nmap <C-tab> :tabnext<cr>
:nmap <C-t> :tabnew<cr>
:map <C-t> :tabnew<cr>
:map <C-S-tab> :tabprevious<cr>
:map <C-tab> :tabnext<cr>
:map <C-w> :tabclose<cr>
:imap <C-S-tab> <ESC>:tabprevious<cr>i
:imap <C-tab> <ESC>:tabnext<cr>i
:imap <C-t> <ESC>:tabnew<cr>
Thanks for posting, mosor! Sadly your command lines don't work for me either...
Here's my .vimrc, much of which was cloned from phrakture's :
"""""""""" general options """"""""""
set nocompatible " Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
"syntax enable " enable syntax highlighting and keep current colour settings
syntax on " enable syntax highlighting and override current colour settings
behave xterm " mouse and selection xterm behaviour
filetype plugin indent on " filetype dependent indenting and plugins
set autoindent " indents line relative to the line above it
set autowrite " automatically write contents of file where sensible
set backspace=indent,eol,start " allow backspacing over eevrything in insert mode
set backup backupdir=$HOME/.vim/backup " set backup directory
set cinoptions=g0,:0,l1,(0,t0 " C indentation options
set clipboard=unnamed " yank and paste in visual mode without prepending "*
set cmdheight=1 " cmdline height
set complete=.,t,i,b,w,k " keyword completion configuration
set encoding=utf-8 " encoding
set expandtab " insert spaces instead of tab character
set formatoptions+=l " add format option preventing lines longer than 'textwidth' being broken
set guioptions-=T " no toolbar
set hidden " don't have to save when switching buffers
set history=100 " cmdline history table size
"set ignorecase " search is case insensitive when search term is all lower case
set incsearch " live search while typing search expression
set laststatus=2 " always display the status line
set nohlsearch " no highlighting when performing search
set nowrap " don't wrap visible lines
set number " precede line with line number when printing
set pastetoggle=<F9> " toggle paste mode
set previewheight=5 " preview window size
"set ruler " show line and column in status line
set shell=/bin/sh " set the shell to be used
set shiftwidth=4 " number of spaces used for (auto)indent
set showcmd " show partial command in status line
set showmode " show whether in insert, visual mode etc
set showmatch " indicate matching parentheses, braces etc
set showtabline=2 " File tabs allways visible
set shortmess=a " abbreviate file messages
set smartcase
set smartindent
set softtabstop=4 " tab defaults to 4 spaces while performing editing operations
set splitbelow " split creates new window below current one
set statusline=%-3.3n\ %f\ %r%#Error#%m%#Statusline#\ (%l/%L,\ %c)\ %P%=%h%w\ %y\ [%{&encoding}:%{&fileformat}]\ \ "status line settings
set tabstop=4 " tab defaults to 4 spaces
set textwidth=80 " maximum column width of inserted text - longer lines are broken after whitespace
set ttyfast " for fast terminals - smoother (apparently)
set termencoding=utf-8
set whichwrap=h,l,<,>,[,] " allow line-wrapped navigation
set wildchar=<Tab> " type tab in cmdline to start wildcard expansion
set wildmenu " enhanced cmdline completion
set wildmode=longest:full,full " cmdline completion mode settings
set writebackup " make a file backup before overwriting it
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
"""""""""" keyboard mappings """"""""""
" Dvorak caret navigation
:noremap t <Up>
:noremap h <Down>
:noremap d <Left>
:noremap n <Right>
:noremap k d
:noremap l n
:noremap j t
" Window split and navigation
:noremap <C-w><S-s> :vsplit<CR>
:noremap <C-w>t <C-w><Up>
:noremap <C-w>h <C-w><Down>
:noremap <C-w>d <C-w><Left>
:noremap <C-w>n <C-w><Right>
" Ctrl-s saves
:inoremap <C-s> <Esc>:w<CR>a
:nnoremap <C-s> :w<CR>
" Tab manipulation
":noremap <silent> <C-t> :tabnew<cr>
":noremap <silent> <C-x> :tabc<cr>
":noremap <silent> <C-tab> :tabn<cr>
":noremap <silent> <C-s-tab> :tabp<cr>
"noremap! <silent> <C-t> :tabnew<cr>
"noremap! <silent> <C-x> :tabc<cr>
"noremap! <silent> <C-tab> :tabn<cr>
"noremap! <silent> <C-s-tab> :tabp<cr>
:nmap <C-S-tab> :tabprevious<cr>
:nmap <C-tab> :tabnext<cr>
:nmap <C-t> :tabnew<cr>
:map <C-t> :tabnew<cr>
:map <C-S-tab> :tabprevious<cr>
:map <C-tab> :tabnext<cr>
:map <C-x> :tabclose<cr>
:imap <C-S-tab> <ESC>:tabprevious<cr>i
:imap <C-tab> <ESC>:tabnext<cr>i
:imap <C-t> <ESC>:tabnew<cr>
"Key bindings
noremap <silent> <F1> :Tlist<cr>
noremap <silent> <F2> :VSBufExplore<cr>
"noremap <silent> <F3> :Make<cr>
noremap <silent> <F3> <c-o>:Project<cr>
noremap <silent> <F6> :set spell!<cr>
noremap! <silent> <F1> <c-o>:Tlist<cr>
noremap! <silent> <F2> <c-o>:VSBufExplore<cr>
"noremap! <silent> <F3> <c-o>:Make<cr>
noremap! <silent> <F3> <c-o>:Project<cr>
noremap! <silent> <F6> <c-o>:set spell!<cr>
" I never use these anyway
noremap ( :bprev<cr>
noremap ) :bnext<cr>
":inoremap ^] ^[A
":inoremap ð ^N
" Don't use Ex mode, use Q for formatting
"map Q gq
"""""""""" autocommand stuff """"""""""
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
else
set autoindent " always set autoindenting on
endif " has("autocmd")
" if autocmd is on
if has("autocmd")
" read Ex commands from file if syntax matches
au Syntax {cpp,c,idl} runtime syntax/doxygen.vim
au Syntax {cpp,c,lisp,scheme} runtime plugin/RainbowParenthesis.vim
au FileType qf if &buftype == "quickfix" |
\ setlocal statusline=%-3.3n\ %0*[quickfix]%=%2*\ %<%P |
\endif
au FileType mail setlocal spell
au FileType cvs setlocal spell
au FileType help setlocal statusline=%-3.3n\ [help]%=\ %<%P
" for all files enable cursorline upon entering a window, and disable when
" leaving
"au WinEnter * setlocal cursorline
"au WinLeave * setlocal nocursorline
au BufReadPost * if line("'\"")>0 && line("'\"")<=line("$")|exe "normal g`\""|endif
" syntax highlighting for html that permits embedded javascript
au BufRead *.html set filetype=htmlm4
" when a PKGBUILD is loaded into a buffer, trigger all sh filetype autocommands
" this occurs before modelines are read
au BufRead,BufNewFile PKGBUILD set ft=sh
" when a .as file is loaded into a buffer,, trigger all actionscript
" filetype autocommands, and use C indenting rules
" this occurs before modelines are read
au BufRead,BufNewFile *.as setlocal ft=actionscript cindent
" omni functionality
au FileType css setlocal ofu=csscomplete#CompleteCSS
au Filetype * if exists('&ofu') && &ofu == "" |
\ set ofu=syntaxcomplete#Complete |
\endif
endif
"""""""""" abbreviations and remaps """"""""""
":abbreviate #! #!/usr/bin/env python
"""""""""" other stuff """"""""""
" vim.org tip 867: get help on python in vim, eg :Pyhelp os
:command -nargs=+ Pyhelp :call ShowPydoc("<args>")
function ShowPydoc(module, ...)
let fPath = "/tmp/pyHelp_" . a:module . ".pydoc"
:execute ":!pydoc " . a:module . " > " . fPath
:execute ":sp ".fPath
endfunction
"bracket autocompletion
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap { {<CR>}<ESC>O
autocmd Syntax html,vim inoremap < <lt>><ESC>i| inoremap > <c-r>=ClosePair('>')<CR>
inoremap ) <c-r>=ClosePair(')')<CR>
inoremap ] <c-r>=ClosePair(']')<CR>
inoremap } <c-r>=CloseBracket()<CR>
inoremap " <c-r>=QuoteDelim('"')<CR>
inoremap ' <c-r>=QuoteDelim("'")<CR>
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endf
function CloseBracket()
if match(getline(line('.') + 1), '\s*}') < 0
return "\<CR>}"
else
return "\<ESC>j0f}a"
endif
endf
function QuoteDelim(char)
let line = getline('.')
let col = col('.')
if line[col - 2] == "\\"
"Inserting a quoted quotation mark into the string
return a:char
elseif line[col - 1] == a:char
"Escaping out of the string
return "\<Right>"
else
"Starting a string
return a:char.a:char."\<ESC>i"
endif
endf
"folding options
if has("folding")
" enable folds
set foldenable
" {{{ markers indicate folds
set foldmethod=marker
" leave all/most folds open
set foldlevel=100
endif
" if using gvim
if has('gui_running')
" allow pasting into other applications after visual selection
set guioptions+=a
" use console dialogs instead of popups
set guioptions+=c
" don't add tab pages
set guioptions-=e
" don't include toolbar
set guioptions-=T
" set color scheme
colors zenburn
" if running under windows
if has('win32')
" set number of columns and lines
set columns=120
set lines=60
" select font
set guifont=Bitstream_Vera_Sans_Mono:h8:cANSI
else
" select font
set guifont=Bitstream\ Vera\ Sans\ Mono\ 8
endif
" if we're in a linux console
elseif (&term == 'screen.linux') || (&term =~ '^linux')
" use 8 bit colour
set t_Co=8
" set color scheme
colors desert
" if we're in xterm, urxvt or screen with 256 colours
elseif (&term == 'rxvt-unicode') || (&term =~ '^xterm') || (&term =~ '^screen-256')
" allow mouse in all editing modes
set mouse=a
" use xterm mouse behaviour
set ttymouse=xterm
" set encoding to uft-8
set termencoding=utf-8
" set color scheme
colors desert256-transparent
" if we're in a different terminal
else
" set color scheme
colors desert
endif
" if we're in screen and autocmd is enabled
if &term =~ "^screen" && has("autocmd")
" this fixes background artifacting when leaving vim inside screen
autocmd VimLeave * :set term=screen
endif
let mapleader = "`"
" cd includes current directory, as well as $HOME and projects folders
let &cdpath=','.expand("$HOME").','.expand("$HOME").'/projects'
" if vim version is >= 7
if v:version >= 700
" display cursor line
set cursorline
" Insert mode completion options
set completeopt=menu,menuone,longest,preview
" spellchecker language is US
set spelllang=en_us
" spelling suggestions operate on 'fast' mode with max 20 suggestions
set spellsuggest=fast,20
" use min 1 column for line number
set numberwidth=1
" imma commnt with missspellings, use me tu tesst
endif
"set dictionary=/usr/share/dict/words
" typing q: == :q
nmap q: :q<cr>
" typing :Q == :q
nmap :Q :q<cr>
" man-page autoreturn after view
nmap K K<cr>
iab NDB Author: N David Brown
"tags files search for a project
" :FindTags('~/projects/something')
"command! -nargs=1 -complete=dir FindTags :call ProjectTags(<args>)
"function! ProjectTags(projectbase)
"let tfiles = glob("$(find ".a:projectbase." -name tags -print)")
"let &tags = substitute(tfiles, "\n", ",", "g")
"endfunction
"command! -nargs=* Make :call SilentMake(<f-args>)
"function! SilentMake()
"let oldsp=&shellpipe
"setlocal shellpipe=>%s\ 2>&1
"exe 'silent make '.string(a:000)
"cwindow
"set shellpipe=&oldsp
"redraw! "this screws up the screen sometimes, fix that
"endfunction
"Project
let g:proj_flags = "ibmstg"
let g:proj_window_width = 35
"TODO get this working better
"TagsParser
"let g:TagsParserLastPositionJump = 1
"let g:TagsParserCurrentFileCWD = 1
let g:TagsParserWindowSize = 30
"let g:TagsParserAutoOpenClose = 1
"let g:TagsParserSingleClick = 1
"let g:TagsParserHighlightCurrentTag = 1
"let g:TagsParserSortType = "line"
"let g:TagsParserFileReadTag = 1
"let g:TagsParserFileReadDeleteTag = 1
"enable the Vim 7.0 options
if v:version >= 700
let g:TagsParserCtrlTabUsage = 'tabs'
"Configure the projects - These have been renamed because the projects I work
"on at work are not really what is important, but rather the way they are configured.
let g:TagsParserProjectConfig = {}
let g:TagsParserProjectConfig['/home/griff/devel/pacman-lib/'] = { 'tagsPath' : '/home/griff/devel/pacman-lib/lib/libalpm/,/home/griff/devel/pacman-lib/src/pacman/' }
endif
"TagList
"let Tlist_Display_Tag_Scope = 1 "ugh...
let g:Tlist_Display_Prototype = 1
let g:Tlist_Use_Right_Window = 1
let g:Tlist_Exit_OnlyWindow = 1
let g:Tlist_Enable_Fold_Column = 0
let g:Tlist_Sort_Type = "name"
let g:Tlist_Compact_Format = 0
let g:Tlist_File_Fold_Auto_Close = 0
let g:Tlist_WinWidth = 50
"VTreeExplorer
let g:treeExplVertical = 1
let g:treeExplWinSize = 35
let g:treeExplDirSort = 1
"NetRW
let g:netrw_keepdir = 1
let g:netrw_winsize = 40
let g:netrw_alto = 1
"BufExplorer
let g:bufExplorerOpenMode=1
let g:bufExplorerSortBy='mru'
let g:bufExplorerSplitType='v'
let g:bufExplorerSplitVertSize = 35
let g:bufExplorerShowDirectories=1
"Valgrind
let g:valgrind_arguments = "--leak-check=yes --num-callers=5000 --time-stamp=yes"
let g:valgrind_use_horizontal_window = 1
let g:valgrind_win_height = 7
"DoxygenToolkit
let g:DoxygenToolkit_authorName = "Aaron Griffin"
let g:DoxygenToolkit_briefTag_funcName = "yes"
"ShowMarks
let g:showmarks_enable = 0
let g:showmarks_ignore_type="hmpqr"
"Buftabs
let g:buftabs_only_basename = 1
"Lisp syntax
"let g:lisp_rainbow = 1
- KD
Last edited by KomodoDave (2007-05-04 13:34:16) -
My terminal asked me for my password and now says bash-3.2
I was screwing around with my macBook Pro in terminal and all of a suddent it said type in the pass word. I did so and now it says bash-3.2# does that mean that everything is alright? or is it like a warning
A book on Bash would be helpful.
Practical Guide to Linux Commands, Editors, and Shell Programming, A (2nd Edition) [Paperback] the book Don't be fooled by the name, the second addition includes Mac OS X.
Advanced Bash Script. premise: Examples for everything. I have revision 6.2.
tldp.org/LDP/abs/abs-guide.pdf
BASH Programming - Introduction HOW-TO
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc14
Check you local library. Any book on Bash syntax will do. There will be minor differences but they will not be great.
Sometimes you can get a good deal on used books in Amazon.
Bash Cookbook, Carol Albing, JP Vossen & Cameron Newham (O'Reilly)
I know it's old, but I haven't seen an update. Look.
Mac OS X Tiger in a Nutshell: A Desktop Quick Reference (In a Nutshell (O'Reilly)) http://www.amazon.com/Mac-OS-Tiger-Nutshell-Reference/dp/0596009437/ref=sr_1_4?s =books&ie=UTF8&qid=1285174595&sr=1-4the book
*A Practical Guide to UNIX(R) for Mac OS(R) X Users* (Paperback) the bookThis is for Tiger & written in 2005.
Learning the bash Shell, Cameron Newham (O'Reilly)
Bash Cookbook, Carol Albing, JP Vossen & Cameron Newham (O'Reilly)
for Bash syntax see Advanced Bash Script. I have revision 6.2.
tldp.org/LDP/abs/abs-guide.pdf
BASH Programming - Introduction HOW-TO
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc14
Sometimes you can get a good deal on used book in Amazon. Third edition.
http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=013 1367366&x=0&y=00
I found the second addition of this at my local library. Any book on Bash syntax will do. There will be minor differences but they will not be great.
Maybe you are looking for
-
Cups 1.3 1.4 NETWORK Printer NOT USB
When I had CUPS 1.3 installed Acroread of all apps would take my PDF's and instead of printing them in Portrait manner, they woul be changed to Landscape and shrunk down. With the upgrade to 1.4 now Thunderbird is doing the same thing with anything I
-
Initial Load for marketing Attributes & Attribute sets in Cloud for customer 1405 version
Hi All, I am working on Cloud for Customer Implementation with integration using Netweaver PI. SAP has just upgraded the CfC to 1405 version. In the latest integration guide & scenarios, there is provision to integrate marketing attributes & attribut
-
Sense Error Message when trying to burn Dual-Layer DVDs?
Hey all, I am trying to burn a dual-layer DVD disc with the internal drive in my MacBook Pro. I am getting the same error message from Toast each time I try to burn a disc. I get no response from Disk Utility (it just says "waiting for the disc drive
-
Hi Gurus Iam confused about the uses of cad desktop. I think most of the functions like model/part checkin-out, dir creation, matl creation and bom creation are available in the cad interface itself. So i want to know what are the additional advantag
-
Send to bluetooth context menu disappear msi mpower z97 max AC
what is the problem? every time I turn off the PC and back to light. bluetooth icon disappears from the context menu. I add it manually and restart reappears so install the latest driver for bluetooth