zoukankan      html  css  js  c++  java
  • Linux设置默认shell脚本效果

    效果如图:

    实现方法:在当前用户的家目录下新建文件.vimrc

    [root@nodchen-db01-test ~]# pwd
    /root

    [root@nodchen-db01-test ~]# file .vimrc
    .vimrc: UTF-8 Unicode text

    新建文件并放入以下内容。重新登录后生效

     1 set nocompatible 
     2 set history=100
     3 set lcs=tab:? 
     4 filetype on
     5 filetype plugin on
     6 filetype indent on 
     7 set autoread 
     8 set mouse=c 
     9 syntax enable 
    10 set cursorline
    11 hi cursorline guibg=#00ff00
    12 hi CursorColumn guibg=#00ff00
    13 set foldenable
    14 set foldmethod=manual
    15 set foldcolumn=0
    16 setlocal foldlevel=3
    17 set foldclose=all           
    18 nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
    19 set expandtab
    20 set tabstop=4
    21 set shiftwidth=4
    22 set softtabstop=4
    23 set smarttab
    24 set ai  
    25 set si 
    26 set wrap 
    27 set sw=4        
    28 set wildmenu 
    29 set ruler 
    30 set cmdheight=1 
    31 set lz 
    32 set backspace=eol,start,indent 
    33 set whichwrap+=<,>,h,l 
    34 set magic 
    35 set noerrorbells
    36 set novisualbell
    37 set showmatch 
    38 set mat=4 
    39 set hlsearch
    40 set ignorecase
    41 set encoding=utf-8
    42 set fileencodings=utf-8
    43 set termencoding=utf-8
    44 set smartindent
    45 set cin
    46 set showmatch
    47 set guioptions-=T
    48 set guioptions-=m
    49 set vb t_vb=
    50 set laststatus=4
    51 set pastetoggle=<F9>
    52 set background=dark
    53 highlight Search ctermbg=black  ctermfg=white guifg=white guibg=black
    54 autocmd BufNewFile *.py,*.cc,*.sh,*.java exec ":call SetTitle()"
    55 func SetTitle()  
    56     if expand("%:e") == 'sh'  
    57         call setline(1, "#!/bin/bash")
    58         call setline(2, "##############################################################")  
    59         call setline(3, "# File Name: ".expand("%"))
    60         call setline(4, "# Version: V1.0")
    61         call setline(5, "# Author: nod")
    62         call setline(6, "# Description:")
    63         call setline(7, "##############################################################")
    64     endif  
    65 endfunc
    View Code

    至此配置完成

  • 相关阅读:
    7.20 高博教育 方法
    7.20 高博教育 随机数字(练习)
    7.17 高博教育 流程控制02
    7月17号 高博教育 复习加逻辑运算符
    7月16号 高博教育 知识扩展
    7月16号 高博教育 知识点总结
    7月16号 高博教育 数据运算符和比较运算符
    链式线性表——课上练
    顺序线性表——课上练
    链栈——课上练
  • 原文地址:https://www.cnblogs.com/nodchen/p/9319437.html
Copyright © 2011-2022 走看看