honza / vim-snippets

vim-snipmate default snippets (Previously snipmate-snippets)
MIT License
4.81k stars 2.03k forks source link

not work in the neovim how to check it? #1248

Open woshichuanqilz opened 4 years ago

woshichuanqilz commented 4 years ago

NVIM v0.4.4 OS: Manjaro 20.1 Mikah

install the plugin by vim-plugin install sucess

When I open a py file and type #!<tab> nothing happens why this happened how to check it?

snippets folder

/home/lizhe/.vim/plugged/vim-snippets/snippets

my init.vim file

set tabstop=4 shiftwidth=4 expandtab
" Just Test"
let g:MYVIMRC="~/.config/nvim/init.vim"

" insert date"
:nnoremap <F5> "=strftime("%c")<CR>P
:inoremap <F5> <C-R>=strftime("%c")<CR>

"
"
let mapleader=","

" Key map
vnoremap gh ^
vnoremap gl $
nnoremap gh ^
nnoremap gl $

" ======= 引号 && 括号自动匹配 ======= "
:inoremap ( ()<ESC>i
:inoremap { {}<ESC>i
:inoremap [ []<ESC>i
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
:inoremap ` ``<ESC>i
:inoremap < <><ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap } <c-r>=ClosePair('}')<CR>

nnoremap <c-h> :%s/\v

nnoremap <leader>e :.w !bash
nnoremap <leader>ee :e $MYVIMRC<CR>

"Nagtive"
nnoremap <A-a> <C-o> 
nnoremap <A-d> <C-i>
nnoremap <C-s> :w<CR>

" CtrlP setting
nnoremap <A-m> :CtrlPMRUFiles<CR>
vnoremap <A-m> :CtrlPMRUFiles<CR>
let g:ctrlp_by_filename = 1

nnoremap <leader>n :e ~/linuxconfig/note.md<Cr>
nnoremap <leader>rr :source ~/.config/nvim/init.vim<CR>

autocmd FileType python map <buffer> <leader>rr :w<CR>:exec '!python3' shellescape(@%, 1)<CR>
autocmd FileType python imap <buffer> <leader>rr <esc>:w<CR>:exec '!python3' shellescape(@%, 1)<CR>

" Ctrl Funky
nnoremap <Leader>fu :CtrlPFunky<Cr>
" narrow the list down with a word under cursor
nnoremap <Leader>fU :execute 'CtrlPFunky ' . expand('<cword>')<Cr>
let g:ctrlp_funky_syntax_highlight = 1

let g:ctrlp_extensions = ['funky']

"Insert date
" inoremap date <C-R>=strftime('%F')<CR>
" inoremap 9 <ESC>

cnoremap %s %s/\v
nnoremap <leader>rm :%s/\v\r\n/\r/g<CR>

nnoremap <S-A-h> :wincmd h<CR>
nnoremap <S-A-l> :wincmd l<CR>
nnoremap <C-Tab> :exe "tabn ".g:lasttab<CR>
vnoremap <leader>c "+y

" Tab Control 
nnoremap to :tabo<CR>
"nnoremap <S-A-h> :tabpre<CR>
"nnoremap <S-A-l> :tabnext<CR>

" Copy and Paste setting
imap <c-v> <ESC>"+p<ESC>a
vmap <c-v> <ESC>"+p
nnoremap p p`]
vnoremap y y`]
nnoremap Y y$

" imap <leader>v <ESC>"+p
nmap <leader>v "+p
vmap <leader>v "+p
nmap <leader>a <ESC>mzggVG"+y`z
nmap <leader>d <ESC>ggdG<ESC>"+p:w<CR>

"Trivals
nnoremap <leader>sw :%s/\v<<C-r><C-w>>//g<left><left>
" nnoremap <esc> <esc>:w<CR>
" inoremap <esc> <esc>:w<CR>
nnoremap <c-f> <esc>/\v
inoremap <c-f> <esc>/\v

set titlestring=%{expand('%:p')}\ -\ GVIM titlelen=70

vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)
nmap <leader>i :PlugInstall<CR>

nnoremap <leader>dir V:s/\\/\//g<CR>:noh<CR>
nnoremap <leader>dkh :g/^[\s\|\r]*$/d<CR>

" save the file
"nnoremap ww :w<CR>
nnoremap <leader>rm :%s/\r//g<cr>
nmap <silent> <Leader>t :NERDTreeToggle<CR>
vmap <silent> <Leader>t :NERDTreeToggle<CR>

" line number
set number relativenumber
nnoremap <c-n> :noh<CR>

"css config
let g:cssColorVimDoNotMessMyUpdatetime = 1
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe  " Windows
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = {
  \ 'dir':  '\v[\/]\.(git|hg|svn)$',
  \ 'file': '\v\.(exe|so|dll)$',
  \ 'link': 'some_bad_symbolic_links',
  \ }

" Goyo Config Limelight
"autocmd! User GoyoEnter Limelight
"autocmd! User GoyoLeave Limelight!
"noremap <leader>z <ESC>:Goyo<CR>

" Plug In Part
call plug#begin('~/.vim/plugged')
Plug 'terryma/vim-expand-region'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'junegunn/seoul256.vim'
Plug 'preservim/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'honza/vim-snippets'
"Plug 'sheerun/vim-polyglot'
" Plug 'Xuyuanp/nerdtree-git-plugin'
" Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } }
Plug 'mhinz/vim-startify'
call plug#end()

" set default browser"
"let g:netrw_browsex_viewer= "google-chrome-stable"
let g:seoul256_background = 233
colo seoul256

" Camel Case
nnoremap <leader>cm :s/\(\<[a-zA-Z]\)/\u\1/g<cr>:noh<cr>

set ignorecase
set smartcase
" shortcut for snippet
"autocmd FileType markdown inoremap <buffer> <c-i> ![]()<left><ESC>"+p<ESC>F[a
"autocmd FileType markdown inoremap <buffer> <c-k> []()<left><ESC>"+p<ESC>F[a

"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
  if (has("nvim"))
    "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
    let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  endif
  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  if (has("termguicolors"))
    set termguicolors
  endif
endif

"auto run "
autocmd! bufwritepost $MYVIMRC source $MYVIMRC
" source the VIMRC file when save it
""autocmd BufWritePost ~/.config/nvim/init.vim :source ~/.config/nvim/init.vim
lpil commented 4 years ago

This repo has snippets only, you will also need to use a snippet engine plugin such as Ultisnips or vim-snipmate