Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Software

Journal karniv0re's Journal: .vimrc Updated

Old .vimrc is old. Updating!

let html_wrong_comments = 1
set wm=8 " set wrapmargin
set nohls " turn off highlight on search
set et " turn on expand tab
set tabstop=4
set autoindent
set smartindent
set printoptions=number:y
set ignorecase "ic: ignores case when pattern matching
set smartcase "scs: ignores ignorecase when pattern contains uppercase characters
set hlsearch "hls: highlights search results; ctrl-n or :noh to unhighlight
set linebreak "lbr: causes vim to not wrap text in the middle of a word
set wrap " defaults to line wrap
set showmode " Shows current vi mode in lower left
set wildmenu " Command line suggestions with tab
set wildmode=longest:full,list:full "wim: helps wildmenu auto-completion
set nocompatible " get the most out of vim, sacrifice vi compatibility
set backspace=indent,eol,start " extend functionality for backspace

nmap <leader>z :%s#\<<c-r>=expand("<cword>")<cr>\>#

" colorscheme adjustments :hi lists the symbols and values for this
colo evening " change the colorscheme

" Some custom color modifications. reference :help highlight and :help cterm
" set mode message ( --INSERT-- ) to green
highlight ModeMsg cterm=bold ctermfg=2 ctermbg=black
" set the active statusline to black on white
highlight StatusLine ctermfg=7 ctermbg=9
" set inactive statusline to black on grey
highlight StatusLineNC ctermfg=8 ctermbg=9
syntax on

" turn on comment continuation for C style comments
" formatoptions r adds new comment line automagically
set fo+=r
" only apply on C comments
set com=s1:/*,mb:*,ex:*/

"
" AUTO-COMMANDS
" for Makefiles
autocmd BufEnter ?akefile* set noet ts=8 sw=8 nocindent

" for source code
autocmd BufEnter *.cpp,*.h,*.c,*.java,*.pl,*.js,*.cfm,*.cfc,*.bat,*.html,*.xml set et ts=4 sw=4 cindent

" make the preprocessor stuff a lighter color
hi PreProc ctermfg=yellow
hi Constant cterm=underline,bold ctermfg=9
" turn on comment continuation for C style comments
set fo+=r " formatoptions r adds new comment line automagically
" only apply on C comments, and mail forwarding "> "
set com=s1:/*,mb:*,ex:*/,:>,fb:-

" skeletons

" cf__ sets up ColdFusion page
ab gb__ <div class="ricGroupbox" ric:title="Your groupbox title" ric:collapsible="expanded"><CR><CR><CR></div><UP><UP>

ab cf__ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><CR><html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"><CR><cfset title = "ColdFusion Application"><CR><cfset appName = "Sample Application"><CR><head><CR><SPACE><SPACE><SPACE><SPACE><title><CR><SPACE><SPACE><SPACE><SPACE><cfoutput><CR><SPACE><SPACE><SPACE><SPACE>#title#<CR><BS><BS><BS><BS><SPACE><SPACE><SPACE><SPACE></cfoutput><CR><BS><BS><BS><BS></title><CR><script src="/uit/ricola/2.1/ricola.js" type="text/javascript"></script><CR></head><CR><body><CR><div class="ricAppTemplate" ric:app="<cfoutput>#appName#</cfoutput>" ric:title="<cfoutput>#title#"</cfoutput>><CR>

"ab cfc__ <!--- Application.cfc ---> <CR><CR> <cfcomponent displayname="Application" output="false" hint="Handle the application."> <CR><CR><SPACE><SPACE><SPACE><SPACE> <!--- set up the application ---><CR><cfset this.name = this.applicationTimeout = createTimeSpan(0,2,0,0) /><CR><!--- defaults to cf administrator value ---><CR><cfset this.clientManagement="true|false"/><CR><!--- defaults to cf administrator value ---><CR><cfset this.clientStorage = cookie|registry|datasourceName /><CR><SPACE><SPACE><SPACE><SPACE><cfset this.loginStorage = cookie|session /> <CR><SPACE><SPACE><SPACE><SPACE> <cfset this.sessionManagement = true|false /> <CR><SPACE><SPACE><SPACE><SPACE> <!--- defaults to cf administrator value ---> <CR><SPACE><SPACE><SPACE><SPACE> <cfset this.sessionTimeout = createTimeSpan(0,0,20,0) /> <CR><SPACE><SPACE><SPACE><SPACE> <cfset this.setClientCookies = true|false /> <CR><SPACE><SPACE><SPACE><SPACE> <cfset this.setDomainCookies = true|false /> <CR><SPACE><SPACE><SPACE><SPACE> <!--- defaults to cf administrator value ---> <CR><SPACE><SPACE><SPACE><SPACE> <cfset this.scriptProtect = none|all|list /> <CR><CR><SPACE><SPACE><SPACE><SPACE> <!--- define the page request properties ---> <CR><SPACE><SPACE><SPACE><SPACE> <cfsetting requesttimeout="20" showdebugoutput="false" enablecfoutputonly="false" /> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cffunction name="onApplicationStart" access="public" returntype="boolean" output="false" hint="fires when the application is first created."> <CR><CR> <!--- This is the perfect place to define application-scoped variables (ex. application.DSN for data source structures). If this method is invoked manually, be sure to call structClear() on the application scope before you re-initialize the data values. This will help to ensure a clean refresh. The return boolean signals as to whether or not the application loaded successfully. Returning false will halt the processing of the rest of the events of the current page request. ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfreturn true /> <CR><CR><SPACE><SPACE><SPACE><SPACE> </cffunction> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cffunction name="onSessionStart" access="public" returntype="void" output="false" hint="fires when the session is first created."> <CR> <!--- This is the perfect place to define session-scoped variables (ex. session.cart for eCommerce cart data). If this method is invoked manually, be sure to call structClear() on the session scope before you re-initialized the data values. HOWEVER! before clearing the scope, get a copy of the CFID/CFTOKEN values so that you can store them back into the session during re-initialization. ColdFusion will not automatically re-create these values as calling this event method is not actually restarting the session. ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfreturn /> <CR><CR><SPACE><SPACE><SPACE><SPACE> </cffunction> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cffunction name="onRequestStart" access="public" returntype="boolean" output="false" hint="fires at first part of page processing."> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfargument name="TargetPage" type="string" required="true" /> <CR><CR> <!--- This the perfect place to define request-specific and other request-scoped variables (ex. request.attributes for the union of the form/URL scopes). This is also a good place to do universal form value scrubbing (such as removing smart quotes and trimming form field values). If your application or sessions can handle manual re-initialization, this is a good place to check for those URL flags (ex. structKeyExists(URL, 'resetApp')) and then manually invoke the OnApplicationStart() or OnSessionStart() application events. If you are using the OnRequest() method and you expect this application to be used for flash remoting or CFC-based web service calls, this is the ideal time at which to check for the request type (standard page request vs. web service) and if need be, delete the OnRequest() method from the Application.cfc (ex. structDelete(this, "OnRequest")). If the return value is false, the page processing will be halted. ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfreturn true /> <CR><CR><SPACE><SPACE><SPACE><SPACE> </cffunction> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cffunction name="onRequest" access="public" returntype="void" output="true" hint="fires after pre page processing is complete."> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfargument name="TargetPage" type="string" required="true" /> <CR><CR> <!--- If you include this event then you must include the requested page via a cfinclude tag. The relative path of the template is passed as the only argument to this function. If you include the page in this manner, the processed template becomes what is essentially a "Mix-In" of the Application.cfc, meaning that it is actually part of the Application.cfc code. If you do this, the processed page will have access to the this and variables scopes of the Application.cfc. If the request page is included in this manner, it also means that the requested page will have access to all methods defined in the Application.cfc. This is the perfect place to handle login management. Since this method determines which template gets executed, this is where you can check login status and conditionally include the login template rather than the requested template. ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <!--- include the requested page. ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfinclude template="#arguments.TargetPage#" /> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfreturn /> <CR><CR><SPACE><SPACE><SPACE><SPACE> </cffunction> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cffunction name="onRequestEnd" access="public" returntype="void" output="true" hint="fires after the page processing is complete."> <CR><CR> <!--- This is the perfect place to handle page logging. By doing it here (especially if the first command is a <cfflush> tag), the user experience will not be affected by any processing overhead of this event method. ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfreturn /> <CR><CR><SPACE><SPACE><SPACE><SPACE> </cffunction> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cffunction name="onSessionEnd" access="public" returntype="void" output="false" hint="fires when the session is terminated."> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfargument name="sessionScope" type="struct" required="true" /> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfargument name="applicationScope" type="struct" required="false" default="#structNew()#" /> <CR><CR> <!--- This is the perfect place to clean up sessions that have timed out (ex. deleting uncommitted shopping cart information). This method does not have inherent access to the application scope or the session scope (as the OnRequestEnd() method has access to the request scope). In order to access those scopes, you must use the passed in arguments. ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfreturn /> <CR><CR><SPACE><SPACE><SPACE><SPACE> </cffunction> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cffunction name="onApplicationEnd" access="public" returntype="void" output="false" hint="fires when the application is terminated."> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfargument name="applicationScope" type="struct" required="false" default="#structNew()#" /> <CR><CR> <!--- This is the perfect place to log information about the application. This method does not have inherent access to the application scope. In order to access that scope, you must used the passed in argument. ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfreturn /> <CR><CR><SPACE><SPACE><SPACE><SPACE> </cffunction> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cffunction name="onError" access="public" returntype="void" output="true" hint="fires when an exception occures that is not caught by a try/catch."> <cfargument name="Exception" type="any" required="true" /> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfargument name="EventName" type="string" required="false" default="" /> <CR><CR> <!--- This event gets called when an event fires and allows you to handle that error and include an error handling template if you so desire. However, this event cannot display anything to the user if the error occurs during the OnApplicationEnd() or OnSessionEnd() events as those are not request-related (unless called explicitly during a request). One thing to be aware of (as of MX7) is that the <cflocation> tag throws a runtime Abort exception (which makes sense if you understand that the <cflocation> tag halts the page and flushes header information to the browser). As a work around to this, you can check the passed in Exception type and if its a Abort exception do not process the error: <cfif NOT compareNoCase(arguments.Exception.RootCause.Type, "coldfusion.runtime.AbortException")> <!--- do not process this error ---> <cfreturn /> </cfif> ---> <CR><CR><SPACE><SPACE><SPACE><SPACE> <cfreturn /> <CR><CR><SPACE><SPACE><SPACE><SPACE> </cffunction> <CR><CR> </cfcomponent>
" some abbreviations
ab teh the
ab shoudl should

" ColdFusion abbreviations
ab <<< &lt;
ab >>> &gt;
ab cfq <cfquery><CR></cfquery><up>
ab cfo <cfoutput><CR></cfoutput><up>
"ab cfl <cfloop><CR></cfloop><up><left>
ab cfd <cfdump var="##"><left><left><left>
ab cfquery <cfquery><CR></cfquery><up>
ab cfoutput <cfoutput><CR></cfoutput><up>
"ab cfloop <cfloop><CR></cfloop><up><left>
ab group__ <script language="JavaScript"><cr>StartGroupBox("Get Code","Align: Center");<cr></script><cr><CF_SSI VIRTUAL="/ssi/apps/groupbox/endgroupbox.txt">

" This is supposed to add autocompletion
set dict+="C:\Documents and Settings\icom942\Desktop\Vim\vim71\dict\CF.dict"
silent sv C:\Documents and Settings\icom942\Desktop\Vim\vim71\dict\CF.dict
q

" Mappings
" cmap handles command-line mappings.
" imap handles insert-only mappings.
" map maps keys in normal, visual, and operator-pending mode.
" map! maps keys in Vim's command and insert modes.
" nmap maps keys in normal mode only.
" omap maps keys in operator-pending mode only.
" vmap maps keys in visual mode only.

" ColdFusion comments
imap <f1> <!--- ---><left><left><left><left><left>
imap <c-e> <cfexit />
nmap <c-e> i<cfexit /><esc>

nmap <insert> p
imap <insert> <esc>pi

" Get rid of stupid windows ^M EOL characters
nmap <c-m> :%s/<c-v><c-m>/\r\n/g <cr> :%s/<c-v><c-@>//g <cr>

" Set up an 80 column comment
imap <F3> <!---------------------------------------------------------------------------->

" XXX: Need to Make a function that auto-comments my shit.
" nmap <f3> :execute 's/' . getline(".") . '/test/'<cr>

" Coldfusion loop all set up
imap <f2> <cfloop<space>index="i"<space>from=""<space>to=""<space>step="1"><CR></cfloop><up><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right>

" ctrl-space makes an html space
imap <c-space> &nbsp;
imap <c-return> <br /><space><bs>

" Shift manipulate tabs
nmap <c-t> :tabnew <cr>
nmap <s-right> :tabnext <cr>
nmap <s-left> :tabprevious <cr>
nmap <c-w> :tabclose <cr>

nmap <s-l> <s-v>~
nmap <m-l> ~

" Alt-r set up a href
imap <m-r> <a href=""></a><left><left><left><left>

" Show or hide line numbers
nmap <c-n><c-n> :set invnumber <cr>

" Save with ctrl-s
nmap <c-s> :w <cr>
nmap <c-o> :browse confirm e <cr>
nmap <m-o> :browse confirm view <cr>
" Gives Ctrl-c Ctrl-v copy and paste functionality
vmap <c-c> y
vmap <c-x> x
imap <c-v> <esc>pi
nmap <c-v> :call paste#Paste()<cr>

" NERD comments. Works on highlighted lines or lines under cursor.
vmap <s-c> :call NERDComment(0, "toggle")<cr>
nmap <s-c> <esc>:call NERDComment(1, "toggle")<cr>
vmap <s-s> :call NERDComment(0, "sexy")<cr>
nmap <s-s> <esc>:call NERDComment(1, "sexy")<cr>

map K :!cmd.exe /c "C:\Program Files\Internet Explorer\iexplore.exe" "http://www.google.com/search?hl=en&q=coldfusion+<cword>"<CR>

":execute '%s/mytext/' . myvar . '/'

" Refresh _vimrc without reloading vim
nmap <C-F5> :source C:\Documents and Settings\icom942\Desktop\Vim\_vimrc <CR>

runtime ftplugin/man.vim

This discussion has been archived. No new comments can be posted.

.vimrc Updated

Comments Filter:

The question of whether computers can think is just like the question of whether submarines can swim. -- Edsger W. Dijkstra

Working...