Last active
February 2, 2022 12:16
-
-
Save takase1121/2dc168260914905ac9b9afddfedd1925 to your computer and use it in GitHub Desktop.
my nvim config lol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set mouse=a | |
set number | |
set hidden | |
set clipboard+=unnamedplus | |
" install vimplug if not available | |
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' | |
if empty(glob(data_dir . '/autoload/plug.vim')) | |
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
endif | |
call plug#begin(stdpath('data') . '/plugged') | |
Plug 'Shatur/neovim-ayu' | |
Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': 'python3 -m chadtree deps'} | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' } " We recommend updating the parsers on update | |
Plug 'tpope/vim-sensible' | |
Plug 'tpope/vim-sleuth' | |
Plug 'lukas-reineke/indent-blankline.nvim' | |
Plug 'editorconfig/editorconfig-vim' | |
Plug 'mg979/vim-visual-multi', {'branch': 'master'} | |
Plug 'jdhao/better-escape.vim' | |
Plug 'neovim/nvim-lspconfig' | |
Plug 'ms-jpq/coq_nvim', { 'branch': 'coq' } | |
Plug 'ray-x/lsp_signature.nvim' | |
call plug#end() | |
let g:coq_settings = { | |
\ 'auto_start': 'shut-up', | |
\ 'display.preview.border': 'rounded' | |
\} | |
let g:better_escape_shortcut = 'jj' | |
let g:better_escape_interval = 200 | |
" set theme | |
lua << EOF | |
local ayu = require 'ayu' | |
ayu.setup { mirage = true } | |
ayu.colorscheme() | |
EOF | |
" set treesitter | |
lua << EOF | |
require'nvim-treesitter.configs'.setup { | |
ensure_installed = { "javascript", "lua", "c", "typescript", "python" }, | |
highlight = { | |
enable = true, | |
additional_vim_regex_highlighting = false, | |
}, | |
} | |
EOF | |
" lsp setup | |
lua << EOF | |
require 'lsp_signature'.setup() | |
local lsp = require 'lspconfig' | |
local coq = require 'coq' | |
lsp.clangd.setup(coq.lsp_ensure_capabilities()) | |
lsp.tsserver.setup(coq.lsp_ensure_capabilities()) | |
lsp.pyright.setup(coq.lsp_ensure_capabilities()) | |
lsp.sumneko_lua.setup(coq.lsp_ensure_capabilities({ | |
cmd = { os.getenv('HOME') .. '/lua-language-server/Linux/lua-language-server', os.getenv('HOME') .. '/lua-language-server/main.lua' } | |
})) | |
-- open diagnostic as hover dialog | |
vim.diagnostic.config { | |
virtual_text = false | |
} | |
vim.o.updatetime = 250 | |
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] | |
EOF | |
let mapleader="," | |
nnoremap <C-\> <CMD>CHADopen<CR> | |
nnoremap <Leader>f <CMD>Files<CR> | |
nnoremap <Leader>b <CMD>Buffers<CR> | |
nnoremap <Leader>r <CMD>Rg<CR> | |
nnoremap <SPACE>d <CMD>lua vim.lsp.diagnostic.show_line_diagnostics()<CR> | |
nnoremap <SPACE>a <CMD>lua vim.lsp.buf.code_action()<CR> | |
nnoremap <SPACE>r <CMD>lua vim.lsp.buf.rename()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment