可以使用简单的 linux 下 neovim 配置,增加了对 golang, python,  ruby 脚本文件一键运行快捷方式。

  1. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  2. " PlugList "
  3. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  4.  
  5. " Specify a directory for plugins
  6. " - For Neovim: ~/.local/share/nvim/plugged
  7. " - Avoid using standard Vim directory names like 'plugin'
  8. call plug#begin('~/.local/share/nvim/plugged')
  9.  
  10. " Make sure you use single quotes
  11.  
  12. " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
  13. Plug 'junegunn/vim-easy-align'
  14.  
  15. " Any valid git URL is allowed
  16. Plug 'https://github.com/junegunn/vim-github-dashboard.git'
  17.  
  18. " Multiple Plug commands can be written in a single line using | separators
  19. Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
  20. Plug 'isRuslan/vim-es6' | Plug 'mxw/vim-jsx'
  21.  
  22. " On-demand loading
  23. Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
  24. Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
  25.  
  26. "comments-auto
  27. Plug 'scrooloose/nerdcommenter'
  28.  
  29. " Using a non-master branch
  30. Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
  31.  
  32. " Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
  33.  
  34. " Plugin outside ~/.vim/plugged with post-update hook
  35. Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
  36.  
  37. " Unmanaged plugin (manually installed and updated)
  38. Plug '~/my-prototype-plugin'
  39.  
  40. "theme color
  41. Plug 'tomasr/molokai' | Plug 'altercation/solarized'
  42.  
  43. "Fuzzy file, buffer, mru, tag, etc finder.
  44. Plug 'kien/ctrlp.vim'
  45.  
  46. "multiple selections
  47. Plug 'terryma/vim-multiple-cursors'
  48.  
  49. "Highlights trailing whitespace
  50. Plug 'bronson/vim-trailing-whitespace'
  51.  
  52. "emmet quick-html
  53. Plug 'mattn/emmet-vim'
  54.  
  55. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  56. " plugin settings "
  57. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  58.  
  59. set nocompatible
  60.  
  61. let mapleader=";"
  62.  
  63. " Initialize plugin system
  64. call plug#end()
  65.  
  66. filetype plugin indent on
  67.  
  68. "NerdTree ####
  69. map <C-t> :NERDTreeToggle<CR>
  70.  
  71. "ctrlp ####
  72. let g:ctrlp_map = '<c-p>'
  73. let g:ctrlp_cmd = 'CtrlP'
  74. let g:ctrlp_working_path_mode = 'ra'
  75. set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe
  76. "let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d'
  77.  
  78. "ultisnip ####
  79. let g:UltiSnipsExpandTrigger="<tab>"
  80. let g:UltiSnipsJumpForwardTrigger="<c-b>"
  81. let g:UltiSnipsJumpBackwardTrigger="<c-z>"
  82.  
  83. "nerdcommenter ####
  84. let g:NERDSpaceDelims = 1
  85. let g:NERDTrimTrailingWhitespace = 1
  86.  
  87. "vim-easy-align ####
  88. xmap ga <Plug>(EasyAlign)
  89. nmap ga <Plug>(EasyAlign)
  90.  
  91. "vim-jsx ####
  92. let g:jsx_ext_required = 0
  93.  
  94. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  95. " common setting "
  96. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  97.  
  98. set showcmd
  99.  
  100. set background=dark
  101. set t_Co=256
  102. colorscheme molokai
  103. set number
  104.  
  105. set autoindent
  106. set smartindent
  107. set showmatch
  108. set ignorecase
  109.  
  110. set cursorline
  111.  
  112. set incsearch
  113.  
  114. set display+=lastline
  115.  
  116. set guifont=Inconsolata:h15:cANSI
  117.  
  118. set tabstop=2
  119. set shiftwidth=2
  120. set expandtab
  121.  
  122. set nobackup
  123. set noswapfile
  124. set history=1024
  125. set autochdir
  126. set whichwrap=b,s,<,>,[,]
  127. set nobomb
  128. set backspace=indent,eol,start whichwrap+=<,>,[,]
  129. " set clipboard+=unnamed
  130.  
  131. set clipboard=unnamed
  132.  
  133. set winaltkeys=no
  134.  
  135. set undofile " keep an undo file (undo changes after closing)
  136.  
  137. set ruler " show the cursor position all the time
  138.  
  139. set showcmd " display incomplete commands
  140.  
  141. set cmdheight=1 " 1 screen lines to use for the command-line
  142.  
  143. set showfulltag " show tag with function protype.
  144.  
  145. set guioptions+=b " present the bottom scrollbar when the longest visible line exceed the window
  146.  
  147. set fileencodings=utf-8,gbk2312,gbk,gb18030,cp936
  148.  
  149. set encoding=utf-8
  150.  
  151. set tenc=utf-8
  152.  
  153. set langmenu=zh_CN let $LANG = 'en_US.UTF-8' syntax on syntax enable
  154.  
  155. set autoread
  156.  
  157. set hlsearch
  158.  
  159. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  160. " keyboard-binding "
  161. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  162.  
  163. nmap <leader>s :update<CR>
  164. vmap <leader>s :update<CR>
  165. inoremap <C-BS> <Esc>bdei
  166. nnoremap <C-left> :bn<CR>
  167. nnoremap <C-right> :bp<CR>
  168.  
  169. nnoremap <leader>a ^
  170. vnoremap <leader>a ^ inoremap <leader>a ^
  171. nnoremap <leader>n $
  172. vnoremap <leader>n $ inoremap <leader>n $
  173.  
  174. nmap <leader>tn :tabnew<cr>
  175. nmap <leader>tc :tabclose<cr>
  176. nmap <leader>th :tabp<cr>
  177. nmap <leader>tl :tabn<cr>
  178.  
  179. " 移动分割窗口
  180. nmap <C-j> <C-W>j
  181. nmap <C-k> <C-W>k
  182. nmap <C-h> <C-W>h
  183. nmap <C-l> <C-W>l
  184.  
  185. " 正常模式下 alt+j,k,h,l 调整分割窗口大小
  186. nnoremap <M-j> :resize +5<cr>
  187. nnoremap <M-k> :resize -5<cr>
  188. nnoremap <M-h> :vertical resize -5<cr>
  189. nnoremap <M-l> :vertical resize +5<cr>
  190.  
  191. " 插入模式移动光标 alt + 方向键
  192. inoremap <M-j> <Down>
  193. inoremap <M-k> <Up>
  194. inoremap <M-h> <left>
  195. inoremap <M-l> <Right>
  196.  
  197. " Don't use Ex mode, use Q for formatting
  198. noremap Q gq
  199.  
  200. " trailling whitespace
  201. nnoremap <leader>d :%s/\s\+$//<cr>:let @/=''<CR>
  202.  
  203. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  204. " others "
  205. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  206.  
  207. " Put these in an autocmd group, so that we can delete them easily.
  208.  
  209. augroup vimrcEx
  210. autocmd!
  211.  
  212. " When editing a file, always jump to the last known cursor position.
  213. " Don't do it for commit messages, when the position is invalid, or when
  214. " inside an event handler (happens when dropping a file on gvim).
  215. autocmd BufReadPost *
  216. \ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") |
  217. \ exe "normal g`\"" |
  218. \ endif
  219.  
  220. " Enable spellchecking for Markdown
  221. autocmd FileType markdown setlocal spell
  222.  
  223. " Automatically wrap at 80 characters for Markdown
  224. autocmd BufRead,BufNewFile *.md setlocal textwidth=80
  225.  
  226. " Disable wrap on some languages
  227. autocmd BufRead,BufNewFile *.slim setlocal textwidth=0
  228. autocmd BufRead,BufNewFile *.erb setlocal textwidth=0
  229. autocmd BufRead,BufNewFile *.html setlocal textwidth=0
  230.  
  231. " Automatically wrap at 72 characters and spell check git commit messages
  232. autocmd FileType gitcommit setlocal textwidth=72
  233. autocmd FileType gitcommit setlocal spell
  234.  
  235. " Allow stylesheets to autocomplete hyphenated words
  236. autocmd FileType css,scss,sass setlocal iskeyword+=-
  237.  
  238. " Autocomplete ids and classes in CSS
  239. autocmd FileType css,scss set iskeyword=@,48-57,_,-,?,!,192-255
  240. " Add the '-' as a keyword in erb files
  241. autocmd FileType eruby set iskeyword=@,48-57,_,192-255,$,-
  242.  
  243. " Auto reload VIM when settings changed
  244. autocmd BufWritePost .vimrc so $MYVIMRC
  245. autocmd BufWritePost *.vim so $MYVIMRC
  246. autocmd BufWritePost vimrc.symlink so $MYVIMRC
  247.  
  248. " Make those debugger statements painfully obvious
  249. au BufEnter *.rb syn match error contained "\<binding.pry\>"
  250. au BufEnter *.rb syn match error contained "\<debugger\>"
  251. au BufEnter *.js syn match error contained "\<debugger\>"
  252. au BufEnter *.coffee syn match error contained "\<debugger\>"
  253. augroup END
  254.  
  255. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  256. " i & r color setting "
  257. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  258.  
  259. function! InsertStatuslineColor(mode)
  260. if a:mode == 'i'
  261. hi statusline guibg=red
  262. set cursorline
  263. elseif a:mode == 'r'
  264. hi statusline guibg=blue
  265. else
  266. hi statusline guibg= magenta
  267. endif
  268. endfunction
  269.  
  270. function! InsertLeaveActions()
  271. hi statusline guibg=green
  272. set nocursorline
  273. endfunction
  274.  
  275. au InsertEnter * call InsertStatuslineColor(v:insertmode)
  276. au InsertLeave * call InsertLeaveActions()

end

windows 上的 neovim 配置的更多相关文章

  1. PHP 1:在Windows上安装和配置PHP,Apache和My SQL

    原文:PHP 1:在Windows上安装和配置PHP,Apache和My SQL 如果你Google一把类似的主题,你会发现相关的文章可以塞满你的硬盘.在这里之所以把它再次拿出来,目的是想记录我作为一 ...

  2. Windows上为Apache配置HTTPS

    Windows上为Apache配置HTTPS   转 https://www.cnblogs.com/tianzijiaozi/p/7582671.html   1. 安装OpenSSL: Windo ...

  3. Windows上PostgreSQL安装配置教程

    Windows上PostgreSQL安装配置教程 这篇文章主要为大家详细介绍了Windows上PostgreSQL安装配置教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 PostgreSQL的 ...

  4. 图文介绍openLDAP在windows上的安装配置

    目录 概述 测试环境 安装过程 配置启动 客户端介绍 多级DC的ldif文件的配置 [一].概述 什么叫LDAP呢,概念的东西这里就不多讲了,网上搜索下有很多,本文的重点是介绍如何在windows平台 ...

  5. 在Windows上安装和配置Jenkins

    一.windows上安装Jenkins 1.官网下载Jenkins安装包Jenkins.msi ,进入安装模式,选择默认配置,安装完成之后,就会默认打开浏览器 http://localhost:808 ...

  6. jinkins在windows上的安装 配置C#编译

    首先jinkins在windows上的安装就不说,安装只需要下载相应安装包就可以了,后有些时候经常需要修改端口号.修改如下: 然后重启jenkins服务 首次运行界面 个人建议插件按需安装. 建立一个 ...

  7. Jenkins在windows上的安装配置

     今天是2月14号,所谓西方情人节,下班回来发现,2月14过的比七夕还火热.于是上网百度百科查询了"情人节". 毕竟是中国的百度啊.是这么解释的.我感到很欣慰.过得每一个节日都应该 ...

  8. mongo在centos与windows上部署与配置,及远程连接mongo与数据用户和角色分配

    1.下载mongodb社区版: windows 安装包安装: https://www.mongodb.com/download-center#community(mongo下载中心) 配置环境变量 控 ...

  9. yaf框架在windows上的环境配置和安装

    1.首先检测你的php版本 如图:Architecture:×86和thread Safety:disabled 这个有什么用呢? 2.进入这个网站 tgz是linux下的扩展包,windows下点D ...

随机推荐

  1. Oracle 12c pdb的数据泵导入导出

    12c推出了可插拔数据库,在一个容器cdb中以多租户的形式同时存在多个数据库pdb.在为pdb做数据泵导入导出时和传统的数据库有少许不同.           1,需要为pdb添加tansnames ...

  2. Windows视频桌面壁纸实现(libvlc)(类似于wall paper engine效果)

    简介 这个项目是很久之前的事情了,当时一个朋友正在研究一个国外的软件(wall paper engine ),可以在桌面壁纸层播放视频,也就差不多是动态壁纸的意思. 后来我也动手来实现这个功能,因为手 ...

  3. Git tag 标签操作

    列表 # 列出已有的标签 $ git tag # 为了能及时看到远程上新增的标签, 在上面的命令之前可以fetch一下 git fetch --all --tags --prune # 列出匹配的部分 ...

  4. Uploadify导致Chrome频繁崩溃Crash

    上传功能是工作中经常会遇到的问题,应该作为开发标配的技能每个人都会. 我选用的是Uploadify 3.1.2进行上传,使用方法参考之前的一篇文章, 今天记录下一个我遇到的很神奇的bug chrome ...

  5. 内核编译之vmlinuz vmlinux system.map initrd

    一.vmlinuz  vmlinuz是可引导的.压缩的内核.“vm”代表“Virtual Memory”.Linux 支持虚拟内存,不像老的操作系统比如DOS有640KB内存的限制.Linux能够使用 ...

  6. 【CLR】详解CLR中的程序集

    目录结构: contents structure [+] 程序集的简介 为程序集分配强名称 如何指定程序集的版本资源信息 如何对程序集签名 全局程序集缓存 如何查看程序集的信息 强命名程序集防串改 1 ...

  7. 实例展示elasticsearch集群生态,分片以及水平扩展.

    elasticsearch用于构建高可用和可扩展的系统.扩展的方式可以是购买更好的服务器(纵向扩展)或者购买更多的服务器(横向扩展),Elasticsearch能从更强大的硬件中获得更好的性能,但是纵 ...

  8. C#中DataTable删除多条数据

    //一般情况下我们会这么删除 DataTable dt = new DataTable(); for (int i = 0; i < dt.Rows.Count; i++) { if (99 % ...

  9. 【转】redis 消息队列发布订阅模式spring boot实现

    最近做项目的时候写到一个事件推送的场景.之前的实现方式是起job一直查询数据库,看看有没有最新的消息.这种方式非常的不优雅,反正我是不能忍,由于羡慕本身就依赖redis,刚好redis 也有消息队列的 ...

  10. Nginx配置WebService、MySQL、SQL Server、ORACLE等代理

    首先介绍一下Nginx的基本使用: 注意不要直接双击nginx.exe,这样会导致修改配置后重启.停止nginx无效,需要手动关闭任务管理器内的所有nginx进程 在nginx.exe目录,打开命令行 ...