Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim 学习记录 #23

Open
try-to-fly opened this issue Jan 11, 2023 · 5 comments
Open

vim 学习记录 #23

try-to-fly opened this issue Jan 11, 2023 · 5 comments

Comments

@try-to-fly
Copy link
Collaborator

try-to-fly commented Jan 11, 2023

为什么使用vim

  1. 装逼(很重要)
  2. 高效的快捷键:
    • 删除/复制n行
    • 编辑括号内文本
  3. 丰富的插件系统,支持各种定制化能力。

快捷键

参考:https://github.com/ayamir/nvimdots/wiki/Keybindings

  • 左右分屏:ctrl-w v
  • 上下分屏:ctrl-w s
  • 打开文件树:ctrl+n
  • 打开lazygit:+gg
  • 查询文件:+ff

成品配置

  1. https://github.com/jdhao/nvim-config
  2. https://github.com/ayamir/nvimdots
  3. https://github.com/theniceboy/nvim
@try-to-fly
Copy link
Collaborator Author

set nu
set nocompatible              " be iMproved, required
filetype off                  " required
set ignorecase
set shell=/bin/dash
" hi Normal guibg=NONE ctermbg=NONE

let mapleader=" "

call plug#begin('~/.vim/plugged')
Plug 'mattn/emmet-vim'
Plug 'othree/html5.vim'
Plug 'hail2u/vim-css3-syntax'
Plug 'groenewege/vim-less'
Plug 'tpope/vim-haml'
Plug 'mhinz/vim-startify'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }

" lspconfig
" Plug 'neovim/nvim-lspconfig'
" Plug 'kristijanhusak/defx-git'
" Plug 'kristijanhusak/defx-icons'
" Plug 'hrsh7th/cmp-nvim-lsp'
" Plug 'hrsh7th/cmp-buffer'
" Plug 'hrsh7th/nvim-cmp'
" Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }
" Plug 'onsails/lspkind-nvim'
" Plug 'nvim-lua/popup.nvim'
" Plug 'nvim-lua/plenary.nvim'
" Plug 'nvim-telescope/telescope.nvim'
" Plug 'windwp/nvim-autopairs'
" "Plug 'glepnir/lspsaga.nvim'
" Plug 'tami5/lspsaga.nvim'


Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Plug 'posva/vim-vue'
Plug 'ctrlpvim/ctrlp.vim'
" Plug 'itchyny/lightline.vim'
Plug 'glepnir/spaceline.vim'
Plug 'neoclide/macdown.vim'
Plug 'easymotion/vim-easymotion'
Plug 'mileszs/ack.vim'

" themes
Plug 'sickill/vim-monokai'
Plug 'kristijanhusak/vim-hybrid-material'
Plug 'jacoborus/tender.vim'
" Plug 'morhetz/gruvbox'
Plug 'lifepillar/vim-gruvbox8'

Plug 'pangloss/vim-javascript'
Plug 'kchmck/vim-coffee-script'
Plug 'leafgarland/typescript-vim'
Plug 'wavded/vim-stylus'

Plug 'vim-scripts/taglist.vim'
Plug 'liuchengxu/vista.vim'
Plug 'scrooloose/nerdcommenter'
Plug 'yianwillis/vimcdoc'
Plug 'hotoo/pangu.vim'
Plug 'ryanoasis/vim-devicons'

Plug 'luochen1990/rainbow'

Plug 'christoomey/vim-tmux-navigator'

" 类似于vscode的gitlens
Plug 'APZelos/blamer.nvim'

" git 插件
Plug 'tpope/vim-fugitive'
Plug 'junegunn/gv.vim'

" rust开发相关
Plug 'rust-lang/rust.vim'

" 搜索插件
Plug 'Yggdroot/LeaderF', { 'do': './install.sh' }

Plug 'peitalin/vim-jsx-typescript'
Plug 'ianks/vim-tsx'

Plug 'MaxMEllon/vim-jsx-pretty'

Plug 'puremourning/vimspector'

Plug 'neoclide/jsonc.vim'

" markdown相关
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'

Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } }

"Plug 'tenfyzhong/CompleteParameter.vim'

" 书签插件
Plug 'MattesGroeger/vim-bookmarks'

" 另一个文件管理器
Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }

Plug 'kyazdani42/nvim-web-devicons'
Plug 'romgrk/barbar.nvim'

Plug 'metakirby5/codi.vim'

Plug 'github/copilot.vim'

Plug 'styled-components/vim-styled-components', { 'branch': 'main' }


" 自动闭合括号/引号
" Plug 'cohama/lexima.vim'

Plug 'voldikss/vim-floaterm'

nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>


call plug#end()

@try-to-fly
Copy link
Collaborator Author

try-to-fly commented Jan 12, 2023

遇到这个错误还不知道具体原因:

临时解决办法,屏蔽了一些插件消失了,应该是和插件有关。

结论:
经过排查是这个插件导致的问题:https://github.com/glepnir/spaceline.vim

解决办法:nvimdev/spaceline.vim#74 (comment)

@try-to-fly
Copy link
Collaborator Author

all in one的nvim配置:https://github.com/ayamir/nvimdots/wiki/Keybindings

支持所有常用的插件和配置

@try-to-fly
Copy link
Collaborator Author

try-to-fly commented Jan 12, 2023

@try-to-fly
Copy link
Collaborator Author

使用了一段时间的预配置,开始从0配置适合自己的vim
https://github.com/try-to-fly/init.vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant