new stuff

This commit is contained in:
Chris 2021-03-11 23:59:55 -05:00
parent ceb88951b0
commit ddb47a5d74
6 changed files with 102 additions and 144 deletions

View file

@ -25,7 +25,6 @@ else
source ~/.config/nvim/themes/nvcode.vim source ~/.config/nvim/themes/nvcode.vim
" Plugin Configuration " Plugin Configuration
luafile ~/.config/nvim/lua/lsp/general-ls.lua
source ~/.config/nvim/keys/which-key.vim source ~/.config/nvim/keys/which-key.vim
source ~/.config/nvim/plug-config/vim-commentary.vim source ~/.config/nvim/plug-config/vim-commentary.vim
source ~/.config/nvim/plug-config/rnvimr.vim source ~/.config/nvim/plug-config/rnvimr.vim
@ -48,6 +47,8 @@ else
source ~/.config/nvim/plug-config/lsp-saga.vim source ~/.config/nvim/plug-config/lsp-saga.vim
source ~/.config/nvim/plug-config/lightbulb.vim source ~/.config/nvim/plug-config/lightbulb.vim
source ~/.config/nvim/lua/lsp-wrapper.vim source ~/.config/nvim/lua/lsp-wrapper.vim
source ~/.config/nvim/plug-config/lsp-config.vim
luafile ~/.config/nvim/lua/lsp/general-ls.lua
luafile ~/.config/nvim/lua/plugins/galaxyline-config.lua luafile ~/.config/nvim/lua/plugins/galaxyline-config.lua
luafile ~/.config/nvim/lua/plugins/nvimtree-config.lua luafile ~/.config/nvim/lua/plugins/nvimtree-config.lua
luafile ~/.config/nvim/lua/plugins/treesitter-config.lua luafile ~/.config/nvim/lua/plugins/treesitter-config.lua
@ -57,7 +58,6 @@ else
luafile ~/.config/nvim/lua/plugins/compe-config.lua luafile ~/.config/nvim/lua/plugins/compe-config.lua
luafile ~/.config/nvim/lua/plugins/lspsaga-config.lua luafile ~/.config/nvim/lua/plugins/lspsaga-config.lua
" LSP: https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md " LSP: https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md
source ~/.config/nvim/plug-config/lsp-config.vim
luafile ~/.config/nvim/lua/lsp/lsp-config.lua luafile ~/.config/nvim/lua/lsp/lsp-config.lua
luafile ~/.config/nvim/lua/lsp/lua-ls.lua luafile ~/.config/nvim/lua/lsp/lua-ls.lua
luafile ~/.config/nvim/lua/lsp/python-ls.lua luafile ~/.config/nvim/lua/lsp/python-ls.lua

View file

@ -177,10 +177,10 @@ let g:which_key_map.s = {
\ 'a' : [':Telescope lsp_code_actions' , 'code_actions'], \ 'a' : [':Telescope lsp_code_actions' , 'code_actions'],
\ 'A' : [':Telescope builtin' , 'all'], \ 'A' : [':Telescope builtin' , 'all'],
\ 'b' : [':Telescope buffers' , 'buffers'], \ 'b' : [':Telescope buffers' , 'buffers'],
\ 'B' : [':Telescope git_branches' , 'git_branches'], \ 'B' : [':Telescope git_branches' , 'git branches'],
\ 'd' : [':Telescope lsp_document_diagnostics' , 'document_diagnostics'], \ 'd' : [':Telescope lsp_document_diagnostics' , 'document_diagnostics'],
\ 'D' : [':Telescope lsp_workspace_diagnostics' , 'workspace_diagnostics'], \ 'D' : [':Telescope lsp_workspace_diagnostics' , 'workspace_diagnostics'],
\ 'c' : [':Telescope git_bcommits' , 'git_bcommits'], \ 'c' : [':Telescope git_commits' , 'git_commits'],
\ 'C' : [':Telescope git_bcommits' , 'git_bcommits'], \ 'C' : [':Telescope git_bcommits' , 'git_bcommits'],
\ 'f' : [':Telescope find_files' , 'files'], \ 'f' : [':Telescope find_files' , 'files'],
\ 'F' : [':Telescope git_files' , 'git_files'], \ 'F' : [':Telescope git_files' , 'git_files'],
@ -188,12 +188,13 @@ let g:which_key_map.s = {
\ 'G' : [':Telescope current_buffer_tags' , 'buffer_tags'], \ 'G' : [':Telescope current_buffer_tags' , 'buffer_tags'],
\ 'h' : [':Telescope command_history' , 'history'], \ 'h' : [':Telescope command_history' , 'history'],
\ 'H' : [':Telescope help_tags' , 'help_tags'], \ 'H' : [':Telescope help_tags' , 'help_tags'],
\ 'i' : [':Telescope media_files' , 'media files'],
\ 'k' : [':Telescope keymaps' , 'keymaps'], \ 'k' : [':Telescope keymaps' , 'keymaps'],
\ 'l' : [':Telescope loclist' , 'loclist'], \ 'l' : [':Telescope loclist' , 'loclist'],
\ 'm' : [':Telescope marks' , 'marks'], \ 'm' : [':Telescope marks' , 'marks'],
\ 'M' : [':Telescope man_pages' , 'man_pages'],
\ 'o' : [':Telescope vim_options' , 'vim_options'], \ 'o' : [':Telescope vim_options' , 'vim_options'],
\ 'O' : [':Telescope oldfiles' , 'oldfiles'], \ 'O' : [':Telescope oldfiles' , 'oldfiles'],
\ 'M' : [':Telescope man_pages' , 'man_pages'],
\ 'p' : [':Telescope fd' , 'fd'], \ 'p' : [':Telescope fd' , 'fd'],
\ 'P' : [':Telescope spell_suggest' , 'spell_suggest'], \ 'P' : [':Telescope spell_suggest' , 'spell_suggest'],
\ 's' : [':Telescope git_status' , 'git_status'], \ 's' : [':Telescope git_status' , 'git_status'],
@ -248,9 +249,6 @@ let g:which_key_map.g = {
\ } \ }
" \ 'A' : [':Git add %' , 'add current'], " \ 'A' : [':Git add %' , 'add current'],
" \ 'S' : [':!git status' , 'status'], " \ 'S' : [':!git status' , 'status'],
"
"
"
let g:which_key_map.G = { let g:which_key_map.G = {
\ 'name' : '+gist' , \ 'name' : '+gist' ,
@ -268,29 +266,32 @@ let g:which_key_map.G = {
" l is for language server protocol " l is for language server protocol
let g:which_key_map.l = { let g:which_key_map.l = {
\ 'name' : '+lsp' , \ 'name' : '+lsp' ,
\ 'a' : [':Lspsaga code_action' , 'code action'], \ 'a' : [':Lspsaga code_action' , 'quickfix'],
\ 'A' : [':Lspsaga range_code_action' , 'selected action'], \ 'A' : [':Lspsaga range_code_action' , 'selected action'],
\ 'd' : [':LspDefinition' , 'definition'], \ 'd' : [':Telescope lsp_document_diagnostics' , 'document diagnostics'],
\ 'D' : [':LspDeclaration' , 'workspace_diagnostics'], \ 'D' : [':Telescope lsp_workspace_diagnostics', 'workspace diagnostics'],
\ 'f' : [':LspFormatting' , 'format'], \ 'f' : [':LspFormatting' , 'format'],
\ 'h' : [':Lspsaga hover_doc' , 'hover_doc'],
\ 'H' : [':Lspsaga signature_help' , 'signature_help'], \ 'H' : [':Lspsaga signature_help' , 'signature_help'],
\ 'K' : [':LspHover' , 'hover'],
\ 'i' : [':LspImplementation' , 'lsp_info'],
\ 'I' : [':LspInfo' , 'lsp_info'], \ 'I' : [':LspInfo' , 'lsp_info'],
\ 'l' : [':Lspsaga lsp_finder' , 'lsp_finder'], \ 'l' : [':Lspsaga lsp_finder' , 'lsp_finder'],
\ 'L' : [':Lspsaga show_line_diagnostics' , 'line_diagnostics'], \ 'L' : [':Lspsaga show_line_diagnostics' , 'line_diagnostics'],
\ 'n' : [':Lspsaga diagnostic_jump_next' , 'next_diagnostic'],
\ 'o' : [':Vista!!' , 'outline'], \ 'o' : [':Vista!!' , 'outline'],
\ 'p' : [':Lspsaga diagnostic_jump_prev' , 'prev diagnostic'], \ 'p' : [':Lspsaga preview_definition' , 'preview definition'],
\ 'q' : [':Lspsaga code_action' , 'quickfix'], \ 'q' : [':Telescope quickfix' , 'quickfix'],
\ 'r' : [':LspReferences' , 'references'], \ 'r' : [':LspRename' , 'rename'],
\ 'R' : [':LspRename' , 'rename'],
\ 'T' : [':LspTypeDefinition' , 'type defintion'], \ 'T' : [':LspTypeDefinition' , 'type defintion'],
\ 'x' : [':cclose' , 'close quickfix'], \ 'x' : [':cclose' , 'close quickfix'],
\ 'y' : [':LspDocumentSymbol' , 'document symbols'], \ 's' : [':Telescope lsp_document_symbols' , 'document symbols'],
\ 'Y' : [':LspWorkspaceSymbol' , 'workspace symbols'], \ 'S' : [':Telescope lsp_workspace_symbols' , 'workspace symbols'],
\ } \ }
" \ 'D' : [':LspDeclaration' , 'workspace_diagnostics'],
" \ 'r' : [':Telescope lsp_references' , 'references'],
" \ 'p' : [':Lspsaga diagnostic_jump_prev' , 'prev diagnostic'],
" \ 'n' : [':Lspsaga diagnostic_jump_next' , 'next_diagnostic'],
" \ 'q' : [':Lspsaga code_action' , 'quickfix'],
" \ 'i' : [':LspImplementation' , 'lsp_info'],
" \ 'h' : [':Lspsaga hover_doc' , 'hover_doc'],
" \ 'K' : [':LspHover' , 'hover'],
" t is for terminal " t is for terminal
let g:which_key_map.t = { let g:which_key_map.t = {
@ -309,52 +310,4 @@ let g:which_key_map.t = {
\ 'u' : [':FloatermNew ncdu' , 'ncdu'], \ 'u' : [':FloatermNew ncdu' , 'ncdu'],
\ } \ }
" w is for wiki
" let g:which_key_map.w = {
" \ 'name' : '+wiki' ,
" \ 'w' : ['<Plug>VimwikiIndex' , 'ncdu'],
" \ 'n' : ['<plug>(wiki-open)' , 'ncdu'],
" \ 'j' : ['<plug>(wiki-journal)' , 'ncdu'],
" \ 'R' : ['<plug>(wiki-reload)' , 'ncdu'],
" \ 'c' : ['<plug>(wiki-code-run)' , 'ncdu'],
" \ 'b' : ['<plug>(wiki-graph-find-backlinks)' , 'ncdu'],
" \ 'g' : ['<plug>(wiki-graph-in)' , 'ncdu'],
" \ 'G' : ['<plug>(wiki-graph-out)' , 'ncdu'],
" \ 'l' : ['<plug>(wiki-link-toggle)' , 'ncdu'],
" \ 'd' : ['<plug>(wiki-page-delete)' , 'ncdu'],
" \ 'r' : ['<plug>(wiki-page-rename)' , 'ncdu'],
" \ 't' : ['<plug>(wiki-page-toc)' , 'ncdu'],
" \ 'T' : ['<plug>(wiki-page-toc-local)' , 'ncdu'],
" \ 'e' : ['<plug>(wiki-export)' , 'ncdu'],
" \ 'u' : ['<plug>(wiki-list-uniq)' , 'ncdu'],
" \ 'U' : ['<plug>(wiki-list-uniq-local)' , 'ncdu'],
" \ }
" Global
" <Plug>VimwikiIndex
" <Plug>VimwikiTabIndex
" <Plug>VimwikiUISelect
" <Plug>VimwikiDiaryIndex
" <Plug>VimwikiMakeDiaryNote
" <Plug>VimwikiTabMakeDiaryNote
" <Plug>VimwikiMakeYesterdayDiaryNote
" <Plug>VimwikiMakeTomorrowDiaryNote
"
" " Local
" <Plug>Vimwiki2HTML
" <Plug>Vimwiki2HTMLBrowse
" <Plug>VimwikiDiaryGenerateLinks
" <Plug>VimwikiFollowLink
" <Plug>VimwikiSplitLink
" <Plug>VimwikiVSplitLink
" <Plug>VimwikiTabnewLink
" <Plug>VimwikiGoBackLink
" <Plug>VimwikiNextLink
" <Plug>VimwikiPrevLink
" <Plug>VimwikiGoto
" <Plug>VimwikiDeleteLink
" <Plug>VimwikiRenameLink
" <Plug>VimwikiAddHeaderLevel
" Register which key map
call which_key#register('<Space>', "g:which_key_map") call which_key#register('<Space>', "g:which_key_map")

View file

@ -1,76 +1,73 @@
local actions = require('telescope.actions') local actions = require('telescope.actions')
-- Global remapping -- Global remapping
------------------------------ ------------------------------
-- '--color=never', -- '--color=never',
require('telescope').setup{ require('telescope').load_extension('media_files')
defaults = { require('telescope').setup {
vimgrep_arguments = { defaults = {
'rg', vimgrep_arguments = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'},
'--no-heading', prompt_position = "top",
'--with-filename', prompt_prefix = "",
'--line-number', selection_caret = "",
'--column', entry_prefix = " ",
'--smart-case' initial_mode = "insert",
selection_strategy = "reset",
sorting_strategy = "descending",
layout_strategy = "horizontal",
layout_defaults = {horizontal = {mirror = false}, vertical = {mirror = false}},
file_sorter = require'telescope.sorters'.get_fuzzy_file,
file_ignore_patterns = {},
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
shorten_path = true,
winblend = 0,
width = 0.75,
preview_cutoff = 120,
results_height = 1,
results_width = 0.8,
border = {},
borderchars = {'', '', '', '', '', '', '', ''},
color_devicons = true,
use_less = true,
set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil,
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
-- Developer configurations: Not meant for general override
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
-- To disable a keymap, put [map] = false
-- So, to not map "<C-n>", just put
-- ["<c-x>"] = false,
-- Otherwise, just set the mapping to the function that you want it to be.
-- ["<C-i>"] = actions.select_horizontal,
-- Add up multiple actions
["<CR>"] = actions.select_default + actions.center
-- You can perform as many actions in a row as you like
-- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
},
n = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous
-- ["<esc>"] = actions.close,
-- ["<C-i>"] = my_cool_custom_action,
}
}
}, },
prompt_position = "bottom", require'telescope'.setup {
prompt_prefix = "", extensions = {
selection_caret = "", media_files = {
entry_prefix = " ", -- filetypes whitelist
initial_mode = "insert", -- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
selection_strategy = "reset", filetypes = {"png", "webp", "jpg", "jpeg"},
sorting_strategy = "descending", find_cmd = "rg" -- find command (defaults to `fd`)
layout_strategy = "horizontal", }
layout_defaults = { }
horizontal = { }
mirror = false,
},
vertical = {
mirror = false,
},
},
file_sorter = require'telescope.sorters'.get_fuzzy_file,
file_ignore_patterns = {},
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
shorten_path = true,
winblend = 0,
width = 0.75,
preview_cutoff = 120,
results_height = 1,
results_width = 0.8,
border = {},
borderchars = { '', '', '', '', '', '', '', '' },
color_devicons = true,
use_less = true,
set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
-- Developer configurations: Not meant for general override
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
-- To disable a keymap, put [map] = false
-- So, to not map "<C-n>", just put
-- ["<c-x>"] = false,
-- Otherwise, just set the mapping to the function that you want it to be.
-- ["<C-i>"] = actions.select_horizontal,
-- Add up multiple actions
["<CR>"] = actions.select_default + actions.center,
-- You can perform as many actions in a row as you like
-- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
},
n = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
-- ["<esc>"] = actions.close,
-- ["<C-i>"] = my_cool_custom_action,
},
},
}
} }

View file

@ -3,10 +3,14 @@ nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR> nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR> nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR> nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR> nnoremap <silent> ca :Lspsaga code_action<CR>
" nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <silent> K :Lspsaga hover_doc<CR>
nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR> nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
nnoremap <silent> <C-p> <cmd>lua vim.lsp.diagnostic.goto_prev()<CR> " nnoremap <silent> <C-p> <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
nnoremap <silent> <C-n> <cmd>lua vim.lsp.diagnostic.goto_next()<CR> " nnoremap <silent> <C-n> <cmd>lua vim.lsp.diagnostic.goto_next()<CR>
nnoremap <silent> <C-p> :Lspsaga diagnostic_jump_prev<CR>
nnoremap <silent> <C-n> :Lspsaga diagnostic_jump_next<CR>
" autoformat " autoformat
autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100) autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100)
autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100) autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100)

View file

@ -1,5 +1,5 @@
" Make Ranger replace netrw and be the file explorer " Make Ranger replace netrw and be the file explorer
" let g:rnvimr_ex_enable = 1 let g:rnvimr_ex_enable = 1
let g:rnvimr_draw_border = 1 let g:rnvimr_draw_border = 1

View file

@ -70,6 +70,7 @@ call plug#begin('~/.config/nvim/autoload/plugged')
Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim' Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-media-files.nvim'
" Intellisense " Intellisense
Plug 'neovim/nvim-lspconfig' Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/nvim-compe' Plug 'hrsh7th/nvim-compe'
@ -78,6 +79,7 @@ call plug#begin('~/.config/nvim/autoload/plugged')
Plug 'kosayoda/nvim-lightbulb' Plug 'kosayoda/nvim-lightbulb'
Plug 'mfussenegger/nvim-jdtls' Plug 'mfussenegger/nvim-jdtls'
Plug 'mfussenegger/nvim-dap' Plug 'mfussenegger/nvim-dap'
" https://github.com/mhartington/formatter.nvim look into this
" File Explorer " File Explorer
Plug 'kyazdani42/nvim-tree.lua' Plug 'kyazdani42/nvim-tree.lua'
" Themes " Themes
@ -104,6 +106,8 @@ call plug#begin('~/.config/nvim/autoload/plugged')
Plug 'norcalli/nvim-colorizer.lua' Plug 'norcalli/nvim-colorizer.lua'
" live server " live server
Plug 'turbio/bracey.vim' Plug 'turbio/bracey.vim'
" Better quickfix
Plug 'kevinhwang91/nvim-bqf'
endif endif
call plug#end() call plug#end()