Vim and bash profile source files under Linux

Source: Internet
Author: User
Tags posix set background egrep

1. ~/.VIMRC

"Get rid of nasty about VI consistency mode, avoid some bugs and limitations of previous versions set Nocompatibleset Autoread" Automatically load set after file modification Completeopt=longest,menu "Auto End Set history=1000 "Record history of rows set backspace=2" Setting backspace key available, normal processing indent, EOL, start and other set VB t_vb= "when Vim is programmed  If the command is incorrect, an alert is issued, and the setting removes the alert filetype on "type filetype plugin on" load file type plug-in filetype indent on " Load related indent files for a specific file type topic, display facet set Background=dark "background using black set Showmatch" to set the matching pattern, similar to when entering an opening parenthesis matches the corresponding right parenthesis set rule                R "Displays the line number and column number where the cursor is located on the status line set ShowCmd" status bar displays the currently executed instruction set number "Display line numbers syntax on "Syntax high brightness display set Cursorline" Highlight cursor row set report=0 "by using: Commands command, tell us which line of the file has been changed set sho Rtmess=ati "Do not show that aid Somalia children's prompt at startup set HELPLANG=CN the" Chinese "format aspect" The following two lines are useful for formatting when writing code; "The first line, Vim uses automatic alignment, that is, the current line to the next line; "The second line, according to the above format, intelligent selection of the way, for similar C language coding" write very useful "set Cindent" (Cindent is specifically for the C language Grammar automatic indentation) set Autoindentset Smar        Tindentset paste         "Preserve formatting when pasting set tabstop=4" The first line sets the TAB key to 4 spaces set shiftwidth=4 "sets the 4 spaces set when interlaced between rows softtabstop=4 "Press BACKSPACE when you can delete 4 spaces set Noexpandtab" Do not use spaces instead of tabs "query is very convenient, such as to find the book word, when input to/b, will automatically find the first" B "word, when entered into/bo, will automatically find The first Bo begins with the word, according to the "second analogy, when looking, use this setting will quickly find the answer, when you find the word to match", don't forget to enter set Incsearchset hlsearchset IC "ignorecase" encoded set Encoding=utf-8set Fileencodings=utf-8,gbk,gb18030,big5set Termencoding=utf-8 " You can use the mouse anywhere in buffer (similar to double-clicking the mouse in the workspace in office) set Mouse=aset mouse=vset selection=exclusiveset Selectmode=mouse,key " Use SPACEBAR to switch folding set Foldenableset foldmethod=manualnnoremap @= ((foldclosed (Line ('. ')) < 0)?   ' Zc ': ' zo ') "set foldmethod=indent" after modifying a file, the backup file name is the original filename plus "~" suffix "if has (" VMS ")" note double quotation marks to use half-width quotation marks "" "Set Nobackup" Else " Command line autocomplete operation in set backup "endif" set Wildmenu "enhanced mode" Autocmd FileType ruby,eruby set omnifunc=rubycomplete#complete "Au Tocmd 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 Java set omnifunc= Javacomplete#complet "TList" let Tlist_use_left_window=1 ' let tlist_file_fold_auto_close=1 ' let tlist_show_one_file=1 "Let Tlist_gainfocus_on_toggleopen=1" let tlist_exit_onlywindow=1 "let g:winmanagerwindowlayout= ' FileExplorer '" nmap Tl:tlist<cr> "Map <space> <ESC><C-g>

2. ~/.BASHRC

# ~/.bashrc:executed by Bash (1) for Non-login shells.# See/usr/share/doc/bash/examples/startup-files (in the package bas H-doc) # for examples# If not running interactively, don't do anything[-Z "$PS 1"] && return# don ' t put duplicate Lines in the history. See Bash (1) for more options# ... or ignoredups and ignorespacehistcontrol=ignoredups:ignorespace# append to the Tory file, don ' t overwrite itshopt-s histappend# for setting history length see Histsize and Histfilesize in Bash (1) hists ize=1000histfilesize=2000# Check the window size after each command and, if necessary,# update the values of LINES and COL Umns.shopt-s checkwinsize# make less more friendly for non-text input files, see Lesspipe (1) [-x/usr/bin/lesspipe] &amp  ;& eval "$ (shell=/bin/sh lesspipe)" # Set variable identifying the chroot you work in (used in the prompt below) if [-Z "$debian _chroot"] && [-r/etc/debian_chroot]; Then debian_chroot=$ (cat/etc/debian_chroot) fi# set a fancy proMPT (Non-color, unless we know we "want" color) case "$TERM" in Xterm-color) Color_prompt=yes;; esac# uncomment for a colored prompt, if the terminal have the capability; turned# off by default to not distract the user:the focus in a terminal window# should is on the output of commands, not On the Promptforce_color_prompt=yesif [-n "$force _color_prompt"]; Then if [-x/usr/bin/tput] && tput SETAF 1 >&/dev/null; Then # We have a color support; Assume it ' s compliant with Ecma-48 # (iso/iec-6429).    (Lack of such support are extremely rare, and such # a case would tend to support setf rather than SETAF.) Color_prompt=yes else color_prompt= fifiif ["$color _prompt" = yes]; Then ps1= ' ${debian_chroot:+ ($debian _chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\ ]\w\[\033[00m\]\$ ' Else ps1= ' ${debian_chroot:+ ($debian _chroot)}\[email protected]\h:\w\$ ' Fiunset color_ Prompt force_color_prompt# If This was an xterm set the TITle to [email protected]:d ircase "$TERM" inxterm*|rxvt*) ps1= "\[\e]0;${debian_chroot:+ ($debian _chroot)}\[email  protected]\h: \w\a\] $PS 1 ";; *)    ;; esac# enable color support of LS and also add handy aliasesif [-x/usr/bin/dircolors]; Then test-r ~/.dircolors && eval "$ (dircolors-b ~/.dircolors)" | |    Eval "$ (dircolors-b)" Alias ls= ' ls--color=auto ' #alias dir= ' dir--color=auto ' #alias vdir= ' VDir--color=auto ' Alias grep= ' grep--color=auto ' Alias fgrep= ' Fgrep--color=auto ' Alias egrep= ' egrep--color=auto ' fi# some more LS a Liasesalias ll= ' ls-alf ' Alias la= ' ls-a ' Alias l= ' ls-cf ' Alias s= ' sudo shutdown-h 0 ' alias m= ' sudo mentohust ' # Add an ' Aler  T "Alias for long running commands. Use like so:# sleep 10; Alertalias alert= ' Notify-send--urgency=low-i "$ ([$? = 0] && echo Terminal | | echo error) "" $ (history|tail-n1|sed-e ' s/^\s*[0-9]\+\s*//;s/[;&| ") \s*alert$//' \ ') ' # Alias definitions.# want to put all your additions into a separate file like# ~/.bash_aliases, instead of adding them here directly.# see/usr/share/doc/bash-doc/examples In the Bash-doc Package.if [-f ~/.bash_aliases]; Then. ~/.bash_aliasesfi# Enable programmable completion features (you don't need to enable# this, if it ' s already enabled In/et C/BASH.BASHRC and/etc/profile# SOURCES/ETC/BASH.BASHRC). If [-f/etc/bash_completion] &&! Shopt-oq POSIX; Then. /etc/bash_completionfi

3./ETC/BASH.BASHRC

# system-wide. bashrc file for interactive bash (1) shells.# to enable the settings/commands in this file for login shell s as well,# this file have to is sourced in/etc/profile.# If not running interactively, don ' t do anything[-Z "$PS 1"] &am p;& return# Check the window size after each command and, if necessary,# update the values of LINES and columns.shopt -S checkwinsize# set variable identifying the chroot you work in (used in the prompt below) if [-Z] $debian _chroot "] &amp ;& [-r/etc/debian_chroot]; Then debian_chroot=$ (cat/etc/debian_chroot) fi# set a fancy prompt (Non-color, overwrite the one in/etc/profile) ps1= ' $ {debian_chroot:+ ($debian _chroot)}\[email protected]\h:\w\$ ' # commented out, don ' t overwrite xterm-t "title"-N "    Icontitle "by default.# If the-is-xterm set the title to [email protected]:d ir#case" $TERM "in#xterm*|rxvt*) # Prompt_command= ' Echo-ne "\033]0;${user}@${hostname}: ${pwd}\007" ' #; #*)#    ;; #esac # Enable bash completion in Interactive shells#if [-f/etc/bash_completion] &&! Shopt-oq POSIX; then#. /etc/bash_completion#fi# sudo hintif [!-e "$HOME/.sudo_as_admin_successful"] && [!-e "$HOME/.hushlogin"]; Then case "$ (groups)" in *\ admin\ *) if [-x/usr/bin/sudo];    Then cat <<-eof to run a command as administrator (user "root") with "sudo <command>".        See "Mans Sudo_root" for details. EOF fi esacfi# If the Command-not-found package are installed, use itif [-x/usr/lib/command-not-found-o-x/usr/sh Are/command-not-found/command-not-found];                Then function command_not_found_handle {# Check because c-n-f could ' ve been removed in the meantime if [-x/usr/lib/command-not-found];                Then/usr/bin/python/usr/lib/command-not-found--"$" return $? elif [-x/usr/share/command-not-found/command-not-found]; Then/usr/bin/python/usr/share/command-not-found/commanD-not-found--"$" return $? else printf "%s:command not found\n" "$" >&2 return 127 fi}fi

Vim and bash profile source files under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.