Desktop app configs
Last edited June 27, 2008
More by Ajnasz »
conkyrc

background yes
alignment top_right
use_xft yes
font Monospace:size=8

# default_color cornflowerblue
# default_outline_color white
# default_shade_color 444444
# default_background_color black

mpd_host localhost
mpd_port 6600

update_interval 1.0

total_run_times 0

# options to use it with xcompmgr
own_window no
own_window_hints undecorated,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type desktop

double_buffer yes

minimum_size 400 5
maximum_width 650

draw_shades no
draw_outline no
# draw_border no
border_margin 5

border_width 0
# strippled_borders 8

gap_x 20
gap_y 12
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale no
use_spacer none

color0 cccccc
color1 999999
color2 ffffff
color3 dddddd
color4 cccccc

TEXT
${color1}${stippled_hr}${color4}
${font MgOpen Monaco:size=9}SYS${font}
${color2}$nodename - $sysname $kernel
${color2}${font Monaco:size=15}${voffset -34}${alignr}${time %H:%M}
${font}${color2}Load:${color3}    $loadavg
${color2}${font Monaco:size=12}${voffset -25}${alignr}${time %Y-%m-%d}
${font}${color2}Uptime:${color3}  $uptime
${color2}RAM:${color3}     $memperc% ${membar 8}
${color2}Swap:${color3}    $swapperc% ${swapbar 8}
${color2}Battery${color3}  $battery_percent% ${battery_bar 8}
${color2}CPU 0:${color3} ${cpu cpu0}% ${freq cpu0} MHz${alignr}${color2}CPU 1:${color3} ${cpu cpu1}% ${freq cpu1} MHz
${cpugraph cpu0 32,320 999999 dddddd}${alignr}${cpugraph cpu1 32,320 999999 dddddd}
${color1}${stippled_hr}${color4}
${font MgOpen Monaco:size=9}HDD${font}
${color2}/${color3}         ${fs_used /} / ${fs_size /}${alignr}${fs_used_perc /}%
${fs_bar /}
${color2}/home${color3}     ${fs_used /home} / ${fs_size /home}${alignr}${fs_used_perc /home}%
${fs_bar /home}
${color2}/var/www${color3}  ${fs_used /var/www} / ${fs_size /var/www}${alignr}${fs_used_perc /var/www}%
${fs_bar /var/www}
${color2}READ: ${color3}${diskio_read} ${alignr}${color2}WRITE: ${color2}${diskio_write}
${diskiograph 32,650 999999 dddddd}
${color1}${stippled_hr}${color4}
${font MgOpen Monaco:size=9}ETH0${font}
${color2}IP:${color3} ${addr eth0}
${color2}Down:${color3} ${downspeedf eth0}k/s ${totaldown eth0}${alignr}${color2}Up:${color3} ${upspeedf eth0}k/s ${alignr}${totalup eth0}
${downspeedgraph eth0 32,320 999999 dddddd}${alignr}${upspeedgraph eth0 32,320 999999 dddddd}
${color1}${stippled_hr}${color4}
${font MgOpen Monaco:size=9}WLAN0${font}
${color2}ESSID:${color3} ${wireless_essid wlan0}${alignr}${color2}Bitrate${color3}: ${wireless_bitrate wlan0}
${alignc}${color3} ${addr wlan0}
${color2}Quality:${color3} ${wireless_link_qual_perc wlan0}${alignr}${color2}Max quality${color3}: ${wireless_link_qual wlan0}%
${wireless_link_bar wlan0}

${color2}Down${color3}: ${downspeedf wlan0}k/s ${totaldown wlan0}${alignr}${color2}Up${color3}: ${upspeedf wlan0}k/s ${alignr}${totalup wlan0}
${downspeedgraph wlan0 32,320 999999 dddddd}${alignr}${upspeedgraph wlan0 32,320 999999 dddddd}
${color1}${stippled_hr}
${color4}Name                       PID                   CPU%     ${alignr}MEM%
${color2}${top name 1}${color3}          ${top pid 1}                 ${top cpu 1}${alignr}${top mem 1}
${color2}${top name 2}${color3}          ${top pid 2}                 ${top cpu 2}${alignr}${top mem 2}
${color2}${top name 3}${color3}          ${top pid 3}                 ${top cpu 3}${alignr}${top mem 3}
${color2}${top name 4}${color3}          ${top pid 4}                 ${top cpu 4}${alignr}${top mem 4}
${color2}${top name 5}${color3}          ${top pid 5}                 ${top cpu 5}${alignr}${top mem 5}
${color1}${stippled_hr}${color4}
${color4}Memory
${color2}${top_mem name 1}${color3}          ${top_mem pid 1}                 ${top_mem cpu 1}   ${alignr}${top_mem mem 1}
${color2}${top_mem name 2}${color3}          ${top_mem pid 2}                 ${top_mem cpu 2}   ${alignr}${top_mem mem 2}
${color2}${top_mem name 3}${color3}          ${top_mem pid 3}                 ${top_mem cpu 3}   ${alignr}${top_mem mem 3}
${color2}${top_mem name 4}${color3}          ${top_mem pid 4}                 ${top_mem cpu 4}   ${alignr}${top_mem mem 4}
${color2}${top_mem name 5}${color3}          ${top_mem pid 5}                 ${top_mem cpu 5}   ${alignr}${top_mem mem 5}
${color1}${stippled_hr}${color4}
${color4}Syslog
${color2}${tail /var/log/syslog 10}
${color1}${stippled_hr}${color4}
${color}Inbound: ${tcp_portmon 1 32767 count}  Outbound: ${tcp_portmon 32768 61000 count}${alignr}ALL: ${tcp_portmon 1 65535 count}
${color1}${stippled_hr}${color4}
Fluxbox configurations

$ cat ~/.fluxbox/keys
#####################################################
# Mod4 = Windows Button
# Mod1 = Alt Button
#####################################################

#####################################################
# Menu handling
#####################################################

## Hide the menus when left click on the desktop
OnDesktop Mouse1 :HideMenus
## Show the menus when right click on the desktop
OnDesktop Mouse2 :WorkspaceMenu
## Show the rootmenu when middle click on the desktop
OnDesktop Mouse3 :RootMenu

#####################################################
# Workspace handling
#####################################################

## Switch desktop with mouse scroll
OnDesktop Mouse4 :NextWorkspace
OnDesktop Mouse5 :PrevWorkspace

## Show the <n> workspace when press the Alt+<n-1>
Mod4 F1  :Workspace 1
Mod4 F2  :Workspace 2
Mod4 F3  :Workspace 3
Mod4 F4  :Workspace 4
Mod4 F5  :Workspace 5
Mod4 F6  :Workspace 6
Mod4 F7  :Workspace 7
Mod4 F8  :Workspace 8
Mod4 F9  :Workspace 9
Mod4 F10 :Workspace 10

#####################################################
# Window handling
#####################################################

## Show the next window (but not tab) when press Alt+Tab
Mod1 Tab :NextWindow 1
## Show the previous window (but not tab) when press Alt+Shift+Tab
Mod1 Shift Tab :PrevWindow 1

## Maximize the window
Mod1 F10 :Maximize

## Show/hide desktop
# Mod4 m :ToggleCmd {ShowDesktop} {DeIconify all originquite}
## Minimize window
Mod4 m :Minimize

## Kill the window
Mod1 k :KillWindow

## Close the window when press Alt+F4
Mod1 F4 :Close
## Resize the window to 1024x568 when press Alt+F5
Mod1 F5 :ResizeTo 1024 568

## Move to top and expand full width
Mod1 F6 :MacroCmd {MoveTo 0 0 UpperLeft} {ResizeTo 1680 515}
## Move to bottom and expand full width
Mod1 F7 :MacroCmd {MoveTo 0 515 UpperLeft} {ResizeTo 1680 515}
## Move to top left and expand full height
Mod1 F8 :MacroCmd {MoveTo 0 0 UpperLeft} {ResizeTo 840 1035}
## Move to top right and expand full height
Mod1 F9 :MacroCmd {MoveTo 0 0 UpperRight} {ResizeTo 840 1035}

## Move the current window to <n> workspace
Shift Mod4 F1  :TakeToWorkspace 1
Shift Mod4 F2  :TakeToWorkspace 2
Shift Mod4 F3  :TakeToWorkspace 3
Shift Mod4 F4  :TakeToWorkspace 4
Shift Mod4 F5  :TakeToWorkspace 5
Shift Mod4 F6  :TakeToWorkspace 6
Shift Mod4 F7  :TakeToWorkspace 7
Shift Mod4 F8  :TakeToWorkspace 8
Shift Mod4 F9  :TakeToWorkspace 9
Shift Mod4 F10 :TakeToWorkspace 10

## Move the window to the top left corner
Mod4 u :MoveTo 0 0 UpperLeft

## Arrange windows
Mod4 a :ArrangeWindows

## Raise a layer
Mod4 r :RaiseLayer
## Lower a layer
Mod4 l :LowerLayer

### Keymodes
## Move modes
Mod4 w Mod4 m    :KeyMode MoveMode
MoveMode: None k :MoveUp 10
MoveMode: None j :MoveDown 10
MoveMode: None h :MoveLeft 10
MoveMode: None l :MoveRight 10
MoveMode: None d :MoveTo 0 * Right
MoveMode: None a :MoveTo 0 * Left
MoveMode: None w :MoveTo * 0 Upper
MoveMode: None s :MoveTo * 0 Lower

## Resize modes
Mod4 w Mod4 r    :KeyMode ResizeMode
ResizeMode: None k :ResizeVertical -10
ResizeMode: None j :ResizeVertical +10
ResizeMode: None h :ResizeHorizontal -10
ResizeMode: None l :ResizeHorizontal 10


## Kill mode
Mod4 w Mod4 k   :KeyMode KillMode
KillMode: none f :Exec pkill firefox

#####################################################
# Tab handling
#####################################################

## Switch to next tab when press Win+Tab
Mod4 Tab :NextTab
## Switch to previous tab when press Win+Shift+Tab
Mod4 Shift Tab :PrevTab
## Take client out of tab-group
Mod4 d :DetachClient


#####################################################
# Execute commands
#####################################################

## Run gnome terminal whan press Alt+F1
Mod1 F1 :Exec gnome-terminal
## Run fbrun when press Alt+F2
Mod1 F2 :Exec fbrun -pos 700 400
## Run firefox with specified profile
Mod4 f :Exec firefox2
Shift Mod4 f :Exec firefox3
## Run thunderbird
# Mod4 t :Exec thunderbird
Mod4 t :MacroCmd {Workspace 2} {Exec gnome-terminal -e mutt -t mutt}
## Run pidgin
Mod4 p :Exec pidgin
## Run gnome system monitor
# Mod4 s :Exec gnome-system-monitor

## Run nautilus
Mod4 n :Exec pcmanfm
## Printscreen
None 111  :Exec import -window root /home/ajnasz/screenie/`date +shot-%Y-%m-%d-%H%M%S.png`
Mod1 111  :Exec import /home/ajnasz/screenie/`date +shot-%Y-%m-%d-%H%M%S.png`

## amarok stuffs
# None F32 :Exec amarok -r
# None F33 :Exec amarok -t
# None F34 :Exec amarok -f
# None F35 :Exec amarok -s

$ cat ~/.fluxbox/menu
[begin] (fluxbox) {} <>

  [exec] (Terminal) {/usr/bin/gnome-terminal} </usr/share/pixmaps/gnome-terminal.xpm>
  [exec] (Firefox) {firefox -P default} </usr/share/pixmaps/firefox.png>
  [exec] (Thunderbird) {thunderbird} </usr/share/pixmaps/thunderbird.png>
  [exec] (Pidgin) {/usr/bin/pidgin} </usr/share/pixmaps/pidgin-menu.xpm>
  [exec] (Synaptic) {/usr/bin/gksu /usr/sbin/synaptic} </usr/share/synaptic/pixmaps/synaptic_32x32.xpm>

  [separator]

  [submenu] (Apps) {}
    [exec] (File-Roller) {/usr/bin/file-roller} </usr/share/pixmaps/file-roller.xpm>
    [exec] (gcolor2) {/usr/bin/gcolor2} </usr/share/pixmaps/gcolor2/gcolor2.xpm>
    [exec] (Tomboy) {/usr/bin/tomboy} </usr/share/pixmaps/tomboy-32.xpm>
  [end]

  [submenu] (Graphic) {}
    [exec] (The GIMP) {/usr/bin/gimp} </usr/share/pixmaps/gimp.xpm>
    [exec] (gThumb Image Viewer) {/usr/bin/gthumb} </usr/share/pixmaps/gthumb.xpm>
    [exec] (Eye of GNOME) {/usr/bin/eog} </usr/share/pixmaps/gnome-eog.xpm>
    [exec] (Inkscape) {/usr/bin/inkscape} </usr/share/pixmaps/inkscape.xpm>
    [exec] (gtk-recordmydesktop) {/usr/bin/gtk-recordMyDesktop} </usr/share/pixmaps/gtk-recordmydesktop.xpm>
  [end]

  [submenu] (Media) {}
    [exec] (totem) {/usr/bin/totem} </usr/share/pixmaps/totem.xpm>
    [exec] (VLC media player) {/usr/bin/wxvlc} </usr/share/vlc/vlc.xpm>
  [end]

  [submenu] (Network) {}
    [exec] (Epiphany web browser) {/usr/bin/epiphany} <>
    [exec] (Opera) {/usr/bin/opera} </usr/share/pixmaps/opera.xpm>
    [exec] (Sun Java 6 Web Start) {/usr/lib/jvm/java-6-sun-1.6.0.03/bin/javaws -viewer} </usr/share/icons/sun-java6.xpm>
  [end]

  [submenu] (Office)
    [exec] (OpenOffice.org 2.3 Writer) {openoffice.org2.3 -writer} </usr/share/icons/hicolor/32x32/apps/openofficeorg23-writer.png>
    [exec] (OpenOffice.org 2.3 Calc) {openoffice.org2.3 -calc} </usr/share/icons/hicolor/32x32/apps/openofficeorg23-calc.png>
  [end]

  [submenu] (Games) {}
    [exec] (Gnomine) {/usr/games/gnomine} </usr/share/pixmaps/gnomine.xpm>
    [exec] (Gnome Mahjongg) {/usr/games/mahjongg} </usr/share/pixmaps/gnome-mahjongg.xpm>
    [exec] (Armagetron Advanced) {/usr/games/armagetronad} </usr/share/pixmaps/armagetronad.xpm>
    [exec] (Nexuiz) {/usr/games/nexuiz --quiet} </usr/share/pixmaps/nexuiz32x32.xpm>
  [end]

  [submenu] (SysApps) {}
    [exec] (Baobab) {/usr/bin/baobab} </usr/share/pixmaps/baobab.xpm>
    [exec] (Seahorse) {/usr/bin/seahorse} </usr/share/pixmaps/seahorse.png>
    [exec] (GNOME Log Viewer) {/usr/bin/gnome-system-log} </usr/share/pixmaps/gnome-system-log.xpm>
    [exec] (GNOME partition editor) {/usr/bin/gparted} </usr/share/pixmaps/gparted.xpm>
    [exec] (GNOME system monitor) {/usr/bin/gnome-system-monitor} <>
    [exec] (Services Admin) {gksudo /usr/bin/services-admin} </usr/share/gnome-system-tools/pixmaps/services.xpm>
  [end]

  [config] (Configuration)

  [submenu] (Styles) {}
    [stylesdir] (/usr/share/fluxbox/styles)
    [stylesdir] (~/.fluxbox/styles)
  [end]

  [workspaces] (Workspaces)
  [reconfig] (Reconfigure)
  [restart] (Restart)
  [exit] (Exit)

  [separator]

  [exec] (Restart Maiev) {gksudo reboot}
  [exec] (Halt Maiev) {gksudo halt}

[end]
$  cat .fluxbox/startup
# This sets a black background

/usr/bin/fbsetroot -solid black

# This shows the fluxbox-splash-screen
# fbsetbg -C /usr/share/fluxbox/splash.jpg

# Other examples. Check man xset for details.
#
# Turn off beeps:
# xset -b
#
# Increase the keyboard repeat-rate:
# xset r rate 195 35
#
# Your own fonts-dir:
# xset +fp "/home/ajnasz/.fonts"
#
# Your favourite mouse cursor:
# xsetroot -cursor_name right_ptr
#
# Change your keymap:
# xmodmap "/home/ajnasz/.Xmodmap"
wpsetters=feh;


# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
# root-tail --shade /var/log/messages &
/usr/bin/gnome-settings-daemon &
/usr/bin/gnome-power-manager &
/usr/bin/gnome-volume-manager &
/usr/bin/bluetooth-applet &
/home/ajnasz/bin/mousesetup.sh &
# fbpager -w &
/usr/bin/padevchooser &
# xcompmgr -cC -Ff &
/home/ajnasz/bin/delayed-x-start.sh &

exec /usr/bin/fluxbox
# or if you want to keep a log:
# exec /usr/bin/fluxbox -log "/home/ajnasz/.fluxbox/log"


$ cat ~/.fluxbox/init
session.screen0.toolbar.onhead:    1
session.screen0.toolbar.alpha:    255
session.screen0.toolbar.height:    0
session.screen0.toolbar.placement:    BottomCenter
session.screen0.toolbar.layer:    Dock
session.screen0.toolbar.tools:    workspacename, prevworkspace, nextworkspace, iconbar, systemtray, clock
session.screen0.toolbar.maxOver:    false
session.screen0.toolbar.visible:    true
session.screen0.toolbar.onTop:    False
session.screen0.toolbar.autoHide:    false
session.screen0.toolbar.widthPercent:    90
session.screen0.iconbar.mode:    Workspace
session.screen0.iconbar.iconTextPadding:    10l
session.screen0.iconbar.wheelMode:    Screen
session.screen0.iconbar.usePixmap:    true
session.screen0.iconbar.iconWidth:    70
session.screen0.iconbar.alignment:    Relative
session.screen0.overlay.capStyle:    CapNotLast
session.screen0.overlay.joinStyle:    JoinMiter
session.screen0.overlay.lineStyle:    LineSolid
session.screen0.overlay.lineWidth:    1
session.screen0.window.focus.alpha:    255
session.screen0.window.unfocus.alpha:    160
session.screen0.titlebar.left:    Stick
session.screen0.titlebar.right:    Minimize Maximize Close
session.screen0.slit.maxOver:    true
session.screen0.slit.direction:    Vertical
session.screen0.slit.alpha:    255
session.screen0.slit.onhead:    0
session.screen0.slit.layer:    Top
session.screen0.slit.autoHide:    false
session.screen0.slit.onTop:    False
session.screen0.slit.placement:    TopLeft
session.screen0.tabs.intitlebar:    true
session.screen0.tabs.maxOver:    false
session.screen0.menu.alpha:    184
session.screen0.tab.height:    16
session.screen0.tab.placement:    TopLeft
session.screen0.tab.width:    100
session.screen0.workspaceNames:    1,2,3,4,5,6,7,8,9,10,
session.screen0.rowPlacementDirection:    LeftToRight
session.screen0.clickRaises:    true
session.screen0.showwindowposition:    true
session.screen0.colPlacementDirection:    TopToBottom
session.screen0.workspaces:    10
session.screen0.decorateTransient:    false
session.screen0.workspacewarping:    true
session.screen0.defaultDeco:    NORMAL
session.screen0.demandsAttentionTimeout:    500
session.screen0.desktopwheeling:    true
session.screen0.menuDelay:    0
session.screen0.edgeSnapThreshold:    0
session.screen0.menuDelayClose:    0
session.screen0.menuMode:    Delay
session.screen0.focusLastWindow:    True
session.screen0.userFollowModel:    Follow
session.screen0.focusModel:    ClickFocus
session.screen0.imageDither:    true
session.screen0.focusNewWindows:    true
session.screen0.strftimeFormat:    %Y. %m. %d. %A %k:%M
session.screen0.followModel:    Ignore
session.screen0.fullMaximization:    false
session.screen0.windowMenu:   
session.screen0.opaqueMove:    false
session.screen0.windowPlacement:    RowSmartPlacement
session.screen0.resizeMode:    Bottom
session.screen0.windowScrollAction:   
session.screen0.tabFocusModel:    ClickToTabFocus
session.screen0.reversewheeling:    false
session.screen0.allowRemoteActions:    false
session.screen0.windowScrollReverse:    false
session.screen0.rootCommand:   
session.screen0.autoRaise:    true
session.imageDither:    True
session.cacheLife:    5l
session.keyFile:    ~/.fluxbox/keys
session.cacheMax:    200l
session.menuFile:    ~/.fluxbox/menu
session.colorsPerChannel:    4
session.slitlistFile:    ~/.fluxbox/slitlist
session.modKey:    Mod1
session.configVersion:    1
session.styleFile:    /home/ajnasz/.fluxbox/styles/tar_a
session.opaqueMove:    False
session.doubleClickInterval:    250
session.forcePseudoTransparency:    false
session.styleOverlay:    ~/.fluxbox/overlay
session.appsFile:    ~/.fluxbox/apps
session.groupFile:    ~/.fluxbox/groups
session.tabPadding:    0
session.ignoreBorder:    false
session.autoRaiseDelay:    250
session.tabsAttachArea:    Window
~/.xmodmaprc

keycode 146 = F22
keycode 241 = F23
keycode 223 = F24
keycode 142 = F25
keycode 214 = F26
keycode 215 = F27

keycode 174 = F30
keycode 176 = F31

keycode 144 = F32
keycode 162 = F33
keycode 153 = F34
keycode 164 = F35
 
~/.imwheelrc for Microsoft Wireless Notebook Optical Mouse 4000

".*"
None,Up,Alt_L|Right
None,Down,Alt_L|Left

See xorg.conf
.vimrc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Name .vimrc
"" Koszti Lajos [Ajnasz] ajnasz@ajnasz.hu
"" Last modified: 2008-06-27 09:35
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Sources:
""   http://www.stripey.com/vim/vimrc.html
""   http://www.amix.dk/vim/vimrc.html *
""   http://www.oualline.com/vim-cook.html
""   http://hhttp://www.google.hu/search?q=filetype%3Avimrc
""   http://dev.gentoo.org/~welp/confs/vimrc
""   http://mysite.verizon.net/astronaut/vim/index.html
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"" remove VI compatibility and it's bugs
set nocompatible
set ttyfast
filetype on
filetype plugin on
filetype indent on


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Visual stuffs
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"" enable syntax highlighting
syn on
set t_Co=256
colo xoria256
"" set color sheme and other gui stuff
" if has('gui_running')
"   set guifont=Monaco
" else
" endif

"" set background to dark
" set background=dark
" colo shine
"" show the bracket matches
set showmatch
"" how many tenths of a second to blink matching brackets for
set mat=9
"" highlight the search results
set hlsearch
"" search as you type
set incsearch
"" detect non case sensitive search
set smartcase
"" show line numbers
set number
"" ruler display in status line
set noruler
"" statusline formatting
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [ENC=%{&encoding}]\ [TYPE=%Y]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
"" to really show the formatted statusline, change to 0 to restore the original statusline
set laststatus=2
"" hilight the line where the cursor is in
" set cursorline

"" highlight the empty whitespaces on the end of a line
highlight WhiteSpaceLineEnd ctermbg=yellow guibg=yellow ctermfg=green guifg=green
match WhiteSpaceLineEnd /\s\+$/

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Functional stuffs
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"" enable large history
set history=1000
"" change buffer without saving
set hid
"" have command-line completion <Tab> (for filenames, help topics, option names)
"" first list the available options and complete the longest common part,
"" then have further <Tab>s cycle through the possibilities:
set wildmode=list:longest,full
"" use "[RO]" for "[readonly]" to save space in the message line:
set shortmess+=r
"" have the mouse enabled all the time:
set mouse=a
"" show mode at bottom of screen
set showmode
set showcmd
"" Remove startup message
set shm+=I
"" set default encoding
" set encoding=utf-8
""
" set title
"" shows the tab and new line characters
" set list
"
set autoindent
"set smartindent
set cindent
set tabstop=2
set shiftwidth=2
set expandtab
set shiftround

autocmd BufEnter * :syntax sync fromstart " ensure every file does syntax highlighting (full)



""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Folding
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"" turn on folding
set foldenable
"" indent sensitive fold method
set foldmethod=syntax
"" don't fold anything, but i can still fold manually)
" set foldlevel=100


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Buffer stuffs
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"" Restore cursor to file position in previous editign session
set viminfo='10,\"100,:20,%,n~/.viminfo
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
"" save view on file close
"" ! to shut up the error message if I just started the vim
au BufWinLeave * silent! mkview
" This auto command will call LastMod function everytime you save a file
autocmd BufWrite *.sh,.vimrc ks|call LastMod()|'s
"" load view on file close
"" ! to shut up the error message if I just started the vim
au BufWinEnter * silent! loadview


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" My key bindigns
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
source /home/ajnasz/.vim/macros/abbrevations.vim
"" SVN section
map <F8> :new<CR>:read !svn diff<CR>:set syntax=diff buftype=nofile<CR>gg
noremap Tn :tabnext<CR>
noremap Tp :tabp<CR>
noremap Tw :tabs<CR>
noremap Tc :tabclose<CR>
noremap Tf :tabfirst<CR>
noremap Tl :tablast<CR>
noremap To :tabnew<CR>
noremap Te :tabedit<CR>

"" QuickBuffer plugin
let g:qb_hotkey = "<F3>"

"" Automatically close
" inoremap { {}<esc>i
" inoremap [ []<esc>i
" inoremap ( ()<esc>i

inoremap ( ()<ESC>:let leavechar=")"<CR>i
inoremap [ []<ESC>:let leavechar="]"<CR>i
inoremap { {}<ESC>:let leavechar="}"<CR>i
imap <C-k> <ESC>:exec "normal f" . leavechar<CR>a
inoremap hhs <html><head></head><body>
inoremap hhe </body></html>
nnoremap <c-j> /<+.\{-1,}+><cr>c/+>/e<cr>
inoremap <c-j> <ESC>/<+.\{-1,}+><cr>c/+>/e<cr>
source ~/.vim/macros/twitter.vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Filetype
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
augroup filetypedetect
  "" .javascript
  au BufNewFile,BufRead *.js set filetype=javascript
  "" .javascript
  au BufNewFile,BufRead *.css set filetype=css
  "" .bashrc
  au BufNewFile,BufRead *bashrc set filetype=sh
  "" perl
  au BufNewFile,BufRead *.pl,*.pm set filetype=perl

  "" .vimrc
  au BufNewFile,BufRead *vimrc set filetype=vim
  "" .conkyrc
  au BufNewFile,BufRead *conkyrc set filetype=conkyrc
  "" WIKI
  au BufNewFile,BufRead *.wiki setf Wikipedia
  "" SQL
  au BufNewFile,BufRead *.sql setf sql
  "" PHP
  au BufNewFile,BufRead *.php setf php
  "" svn commit
  au BufNewFile,BufRead svn-commit.tmp setf svn
  au BufNewFile,BufRead .mutt/* setf muttrc
augroup end


"" PHP
au FileType php set keywordprg=/home/ajnasz/.vim/doc/php_doc
"" Wiki
au FileType wiki so ~/.vim/syntax/wikipedia.vim

  "" VIM
augroup FileType vim
"  autocmd FileType vim map <buffer> <leader><space> :w!<cr>:source %<cr>
augroup end

"" CSS
augroup FileType css
  au BufRead,BufNewFile *.css set cindent
  au BufRead,BufNewFile *.css set cinwords={,
  au BufRead,BufNewFile *.css set cinkeys=0{,0},0),0#,!^F,e
augroup end

"" TT2
augroup FileType tt2html
  au BufNewFile,BufRead *.tt2 setf tt2html
  au FileType tt2html inoremap <buffer> [% [% %]<esc>bi
  au FileType tt2html inoremap <buffer> c.lo c.loc('')<esc>bbwl
  au BufNewFile,BufRead *.tt2 let b:match_words = '<:>,<html:/html>,<head:/head>,<title:/title>,<body:/body>,<script:/script>,<link:>,<meta:><h1:/h1>,<h2:/h2>,<h3:/h3>,<h4:/h4>,<h5:/h5>,<h6:/h6>,<ul:/ul>,<ol:/ol>,<dl:/dl>,<dd:/dd>,<li:/li>,<a:/a>,<div:/div>,<span:/span>,<img:>,<pre:/pre>,FOREACH:END,IF:ELSE:END,WRAPPER:END,IF:END'
augroup end

augroup FileType html
  au!
  "" HTML related
  "" HTML entities - used by xml edit plugin
"  au BufNewFile,BufRead *.html let xml_use_xhtml = 1
"  au BufNewFile,BufRead *.html let xml_no_auto_nesting = 1

  "" To HTML
"  au BufNewFile,BufRead *.html let html_use_css = 1
"  au BufNewFile,BufRead *.html let html_number_lines = 0
"  au BufNewFile,BufRead *.html let use_xhtml = 1

augroup end

augroup FileType javascript
  au!
  au FileType javascript so ~/.vim/syntax/javascript.vim
  au FileType javascript setl fen

  "" au FileType javascript setl nocindent
  au FileType javascript set dictionary+=~/.vim/dics/js.dic
  au Filetype javascript map [[ ?{<CR>w99[{
  au Filetype javascript map ][ /}<CR>b99]}
  au Filetype javascript map ]] j0[[%/{<CR>
  au Filetype javascript map [] k$][%?}<CR>
augroup end

"" TripWolf settins
augroup tripwolf
  au!
  " set path for tripwolf to find files easily
  au BufRead,BufNewFile /var/www/travelwiki/trunk/*  set path=.,/var/www/travelwiki/trunk/lib,/var/www/travelwiki/trunk/root,/var/www/travelwiki/trunk/templates,/var/www/travelwiki/trunk/
  au BufRead,BufNewFile /var/www/travelwiki/branches/redesign/*  set path=.,/var/www/travelwiki/branches/redesign/lib,/var/www/travelwiki/branches/redesign/root,/var/www/travelwiki/branches/redesign/templates,/var/www/travelwiki/branches/redesign/
  " au BufWrite /var/www/travelwiki/trunk/templates/*.tt2 set bomb
augroup end



" Search the first 20 lines for Last modified: and update the current datetime.
function! LastMod()
  if &modified
    if line("$") > 20
      let l = 20
    else
      let l = line("$")
    endif
    exe "1," . l . "g/Last modified: /s/Last modified: .*/Last modified: " . strftime("%Y-%m-%d %H:%M%p")
  endif
endfun

" function! SuperCleverTab()
"     if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
"       return "\<Tab>"
"     else
"        if &omnifunc != ''
"           return "\<C-X>\<C-O>"
"        elseif &dictionary != ''
"           return “\<C-K>”
"        else
"           return "\<C-N>"
"       endif
"     endif
" endfunction
"" bind function to the tab key
" inoremap <Tab> <C-R>=SuperCleverTab()<cr>


" highlight Normal ctermbg=black ctermfg=white

" date maps
imap <Leader>ymd   <C-R>=strftime("%y%m%d")<CR>
imap <Leader>mdy   <C-R>=strftime("%m/%d/%y")<CR>
imap <Leader>ndy   <C-R>=strftime("%b %d, %Y")<CR>
imap <Leader>hms   <C-R>=strftime("%T")<CR>
imap <Leader>ynd   <C-R>=strftime("%Y %b %d")<CR>
com! YMD :norm! i<C-R>=strftime("%y%m%d")<CR>
com! MDY :norm! i<C-R>=strftime("%m/%d/%y")<CR>
com! NDY :norm! i<C-R>=strftime("%b %d, %Y")<CR>
com! HMS :norm! i<C-R>=strftime("%T")<CR>

com Vbl :VCSBlame
com Vci :VCSCommit
com Vdel :VCSDelete
com Vdi  :VCSDiff
com Vinf :VCSInfo
com Vrev :VCSRevert
com Vst :VCSStatus
com Vup :VCSUpdate
com Vvdi :VCSVimDiff


autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
The content on this page is provided by a Google Notebook user, and Google assumes no responsibility for this content.