1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-24 11:51:50 +08:00

Remove nvim since I have NvChap now

might add back as git submodule soon
 Changes to be committed:
	deleted:    .config/nvim/conf.d/coc.vim
	deleted:    .config/nvim/init.vim
	deleted:    .config/nvim/lua/dap-custom.lua

 Untracked files not listed
This commit is contained in:
juan 2021-08-22 22:56:56 +08:00
parent 85e9d24c17
commit 8aa2e9ee9d
3 changed files with 0 additions and 292 deletions

View File

@ -1,116 +0,0 @@
"settings suggested by coc.
set hidden " Text Edit suggestion by coc
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" Map <tab> for trigger completion, completion confirm, snippet expand and jump
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ?
\ "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Make <CR> notify coc.nvim to
" format on enter, <cr> could be remapped by other vim plugin
" (I disabled enter to confirm.)
inoremap <silent><expr> <cr> "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')
" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-stats` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings for CoCList
" Show all diagnostics.
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
" open COc yank
nnoremap <silent> <space>y :<C-u>CocList -A --normal yank<cr>

View File

@ -1,137 +0,0 @@
call plug#begin('~/.config/nvim/plugged')
" looks
Plug 'vim-airline/vim-airline' " airline for vim
Plug 'ryanoasis/vim-devicons' " adds many icons
Plug 'airblade/vim-gitgutter' " git changes on left.
Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' } " colors
Plug 'mhinz/vim-startify' " start page
Plug 'tomasiser/vim-code-dark' " colorscheme
Plug 'cocopon/iceberg.vim'
" misc
Plug 'vimwiki/vimwiki' " for my note taking.
Plug 'gentoo/gentoo-syntax' " syntax for gentoo related files
" Coding
Plug 'neoclide/coc.nvim', {'branch': 'release'} " code completion
Plug 'chiel92/vim-autoformat' " used to remove trailing spaces.
Plug 'honza/vim-snippets' " snippet supprt.
Plug 'szw/vim-maximizer' " maximizing panel
Plug 'mfussenegger/nvim-dap' " Inspector for vim
Plug 'rcarriga/nvim-dap-ui' " UI for dap
" functions
Plug 'machakann/vim-sandwich' " surrounding
Plug 'preservim/nerdcommenter' " comment out things
Plug 'nvim-lua/popup.nvim' " dependency of teltscope
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim' " replacement of ctrlp
Plug 'tpope/vim-repeat' " repeat support for stuff
Plug 'tpope/vim-fugitive' " Git support.
Plug 'easymotion/vim-easymotion' " better motion!!
Plug 'godlygeek/tabular' " for OCD people.
Plug 'dhruvasagar/vim-table-mode' " Taking notes in vim
" trees and bars
Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'preservim/tagbar' " press <F8> to get a tagbar.
call plug#end()
colorscheme iceberg
set termguicolors
set relativenumber
set number
set shiftwidth=2
set mouse=a
set ignorecase smartcase
set noshowmode
set smartindent
set scrolloff=10
" plugin settings
source ~/.config/nvim/conf.d/*
let g:startify_custom_header = 'startify#pad(startify#fortune#boxed())'
let g:startify_lists = [
\ { 'type': 'dir', 'header': [' MRU @ '. getcwd()] },
\ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'type': 'bookmarks', 'header': [' Bookmarks'] },
\ { 'type': 'commands', 'header': [' Commands'] },
\ ]
let g:startify_commands = [
\ {'w': ['Open Vim Wiki', ':VimwikiIndex']},
\ ]
let g:startify_custom_indices = [
\ 'a', 'd', 'f', 'l', ';', 'g']
let g:startify_skiplist = [
\ '^/tmp',
\ escape(fnamemodify($HOME, ':p'), '\') .'Documents/Personal/Wiki',
\ escape(fnamemodify($HOME, ':p'), '\') .'Encrypted',
\ escape(fnamemodify($HOME, ':p'), '\') .'.config/yadm/repo.git',
\ ]
let g:Hexokinase_ftDisabled = ['css']
let g:vimwiki_list = [{'path': '~/Documents/Personal/Wiki/',
\ 'syntax': 'markdown', 'ext': '.md'}]
" only enable vimwiki in wiki folder
let g:vimwiki_global_ext = 0
lua require("dapui").setup()
" keybindings (except for coc)
" Telescope
" Find files using Telescope command-line sugar.
nnoremap <leader>tf <cmd>Telescope fd<cr>
nnoremap <leader>tg <cmd>Telescope live_grep<cr>
nnoremap <leader>tb <cmd>Telescope buffers<cr>
nnoremap <leader>th <cmd>Telescope help_tags<cr>
" nerdtree tagbar coc formatter.
nnoremap <F12> <cmd>lua require("dapui").toggle()<cr>
nnoremap <F2> <cmd>Format<CR>
nnoremap <F8> <cmd>TagbarToggle<CR>
nnoremap <C-n> <cmd>NERDTreeToggle<CR>
nnoremap <C-l> <cmd>NERDTreeFind<CR>
" easymotion
nmap <space>f <Plug>(easymotion-f)
nmap <space>F <Plug>(easymotion-F)
nmap <space>l <Plug>(easymotion-lineanywhere)
nmap <space>j <Plug>(easymotion-j)
nmap <space>k <Plug>(easymotion-k)
nmap <space>w <Plug>(easymotion-w)
nmap <space>W <Plug>(easymotion-W)
nmap <space>b <Plug>(easymotion-b)
nmap <space>b <Plug>(easymotion-B)
" fix intending.
vmap < <gv
vmap > >gv
" make Y behave like other Capitalized letters
nnoremap Y y$
" n/N also centered
nnoremap n nzzzv
nnoremap N Nzzzv
" undo to the last , . or !
inoremap , ,<c-g>u
inoremap . .<c-g>u
inoremap ! !<c-g>u
inoremap ? ?<c-g>u
" Shortcutting split navigation
map <A-h> <C-w>h
map <A-j> <C-w>j
map <A-k> <C-w>k
map <A-l> <C-w>l
map <A-H> <C-w>H
map <A-J> <C-w>J
map <A-K> <C-w>K
map <A-L> <C-w>L
map <A->> <C-w>>
map <A-<> <C-w><
" Tab shortcuts
nnoremap <A-p> :tabp<CR>
nnoremap <A-n> :tabn<CR>
" map Alt + q to exit terminal mode.
tnoremap <A-q> <C-\><C-n>

View File

@ -1,39 +0,0 @@
local dap = require('dap')
dap.adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb', -- adjust as needed
name = "lldb"
}
local dap = require('dap')
dap.configurations.cpp = {
{
name = "Launch",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
args = {},
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
--
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
--
-- Otherwise you might get the following error:
--
-- Error on launch: Failed to attach to the target process
--
-- But you should be aware of the implications:
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
runInTerminal = false,
},
}
-- If you want to use this for rust and c, add something like this:
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp