Compare commits
6 Commits
bbfd9db3a6
...
e51198465e
Author | SHA1 | Date |
---|---|---|
Rekai Nyangadzayi Musuka | e51198465e | |
Rekai Nyangadzayi Musuka | f5427e049a | |
Rekai Nyangadzayi Musuka | 574692268e | |
Rekai Nyangadzayi Musuka | e8849309ff | |
Rekai Nyangadzayi Musuka | 961ebabfa2 | |
Rekai Nyangadzayi Musuka | ff93fa3a01 |
|
@ -30,6 +30,8 @@ Plug 'glepnir/dashboard-nvim'
|
||||||
|
|
||||||
Plug 'hoob3rt/lualine.nvim'
|
Plug 'hoob3rt/lualine.nvim'
|
||||||
|
|
||||||
|
Plug 'ziglang/zig.vim'
|
||||||
|
|
||||||
Plug 'simrat39/rust-tools.nvim'
|
Plug 'simrat39/rust-tools.nvim'
|
||||||
" One Dark Pro
|
" One Dark Pro
|
||||||
Plug 'joshdick/onedark.vim'
|
Plug 'joshdick/onedark.vim'
|
||||||
|
@ -40,7 +42,10 @@ Plug 'joshdick/onedark.vim'
|
||||||
Plug 'mfussenegger/nvim-dap'
|
Plug 'mfussenegger/nvim-dap'
|
||||||
|
|
||||||
" Autocomplete
|
" Autocomplete
|
||||||
Plug 'hrsh7th/nvim-compe'
|
Plug 'nvim-lua/completion-nvim'
|
||||||
|
Plug 'steelsojka/completion-buffers'
|
||||||
|
Plug 'nvim-treesitter/completion-treesitter'
|
||||||
|
Plug 'kristijanhusak/completion-tags'
|
||||||
Plug 'hrsh7th/vim-vsnip'
|
Plug 'hrsh7th/vim-vsnip'
|
||||||
Plug 'hrsh7th/vim-vsnip-integ'
|
Plug 'hrsh7th/vim-vsnip-integ'
|
||||||
|
|
||||||
|
@ -55,20 +60,29 @@ Plug 'romgrk/barbar.nvim'
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
" nvim-completion
|
||||||
|
autocmd BufEnter * lua require'completion'.on_attach()
|
||||||
|
" Use <Tab> and <S-Tab> to navigate through popup menu
|
||||||
|
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
|
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||||
|
|
||||||
|
" Set completeopt to have a better completion experience
|
||||||
|
set completeopt=menuone,noinsert,noselect
|
||||||
|
|
||||||
|
" Avoid showing message extra message when using completion
|
||||||
|
set shortmess+=c
|
||||||
|
|
||||||
|
let g:completion_enable_snippet = 'vim-vsnip'
|
||||||
|
let g:completion_enable_auto_popup = 1
|
||||||
|
|
||||||
|
imap <silent> <C-Space> <Plug>(completion_trigger)
|
||||||
|
|
||||||
" --Telescope Keybinds--
|
" --Telescope Keybinds--
|
||||||
nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>
|
nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>
|
||||||
nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>
|
nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>
|
||||||
nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>
|
nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>
|
||||||
nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>
|
nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>
|
||||||
|
|
||||||
|
|
||||||
" Compe Keybinds
|
|
||||||
inoremap <silent><expr> <C-Space> compe#complete()
|
|
||||||
inoremap <silent><expr> <CR> compe#confirm('<CR>')
|
|
||||||
inoremap <silent><expr> <C-e> compe#close('<C-e>')
|
|
||||||
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
|
|
||||||
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
|
|
||||||
|
|
||||||
" Which Key Keybinds
|
" Which Key Keybinds
|
||||||
" nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
|
" nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
|
||||||
" nnoremap <silent> <localleader> :<c-u>WhichKey ','<CR>
|
" nnoremap <silent> <localleader> :<c-u>WhichKey ','<CR>
|
||||||
|
@ -148,22 +162,55 @@ highlight NvimTreeFolderIcon guibg=blue
|
||||||
colorscheme onedark
|
colorscheme onedark
|
||||||
|
|
||||||
lua << EOF
|
lua << EOF
|
||||||
|
|
||||||
-- NVIM 0.5 LSP Setup
|
-- NVIM 0.5 LSP Setup
|
||||||
|
|
||||||
local nvim_lsp = require'lspconfig'
|
-- nvim lspconfig
|
||||||
nvim_lsp.pyright.setup{}
|
local nvim_lsp = require('lspconfig')
|
||||||
|
|
||||||
local opts = { noremap=true, silent=true }
|
-- Use an on_attach function to only map the following keys
|
||||||
vim.api.nvim_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
-- after the language server attaches to the current buffer
|
||||||
vim.api.nvim_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_set_keymap('n', '<leader>d', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||||
vim.api.nvim_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||||
vim.api.nvim_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
|
||||||
vim.api.nvim_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
|
||||||
|
|
||||||
|
--Enable completion triggered by <c-x><c-o>
|
||||||
|
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
-- Mappings.
|
||||||
|
local opts = { noremap=true, silent=true }
|
||||||
|
|
||||||
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
|
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||||
|
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||||
|
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||||
|
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||||
|
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
||||||
|
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
||||||
|
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||||
|
-- map buffer local keybindings when the language server attaches
|
||||||
|
local servers = { "pyright", "zls", "tsserver" }
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
nvim_lsp[lsp].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = {
|
||||||
|
debounce_text_changes = 150,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
-- Rust Tools
|
-- Rust Tools
|
||||||
require'rust-tools'.setup{
|
require'rust-tools'.setup{
|
||||||
|
@ -192,19 +239,50 @@ require'nvim-treesitter.configs'.setup {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Telescope Defaults
|
-- Telescope Defaults
|
||||||
require'telescope'.setup {
|
require('telescope').setup{
|
||||||
defaults = {
|
defaults = {
|
||||||
find_command = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'},
|
vimgrep_arguments = {
|
||||||
prompt_position = "bottom",
|
'rg',
|
||||||
prompt_prefix = " ",
|
'--color=never',
|
||||||
|
'--no-heading',
|
||||||
|
'--with-filename',
|
||||||
|
'--line-number',
|
||||||
|
'--column',
|
||||||
|
'--smart-case'
|
||||||
|
},
|
||||||
|
prompt_prefix = "> ",
|
||||||
|
selection_caret = "> ",
|
||||||
|
entry_prefix = " ",
|
||||||
|
initial_mode = "insert",
|
||||||
|
selection_strategy = "reset",
|
||||||
|
sorting_strategy = "descending",
|
||||||
|
layout_strategy = "horizontal",
|
||||||
|
layout_config = {
|
||||||
|
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,
|
||||||
|
winblend = 0,
|
||||||
border = {},
|
border = {},
|
||||||
borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'},
|
borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' },
|
||||||
color_devicons = true,
|
color_devicons = true,
|
||||||
use_less = true,
|
use_less = true,
|
||||||
set_env = {['COLORTERM'] = 'truecolor'},
|
path_display = {},
|
||||||
},
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
-- Barbar Keybinds
|
-- Barbar Keybinds
|
||||||
vim.api.nvim_set_keymap('n', '<TAB>', ':BufferNext<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('n', '<TAB>', ':BufferNext<CR>', { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferPrevious<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferPrevious<CR>', { noremap = true, silent = true })
|
||||||
|
@ -217,75 +295,6 @@ require'nvim-autopairs'.setup()
|
||||||
require'nvim_comment'.setup()
|
require'nvim_comment'.setup()
|
||||||
|
|
||||||
-- Autocomplete
|
-- Autocomplete
|
||||||
vim.o.completeopt = "menuone,noselect"
|
|
||||||
|
|
||||||
require'compe'.setup {
|
|
||||||
enabled = true;
|
|
||||||
autocomplete = true;
|
|
||||||
debug = false;
|
|
||||||
min_length = 1;
|
|
||||||
preselect = 'enable';
|
|
||||||
throttle_time = 80;
|
|
||||||
source_timeout = 200;
|
|
||||||
incomplete_delay = 400;
|
|
||||||
max_abbr_width = 100;
|
|
||||||
max_kind_width = 100;
|
|
||||||
max_menu_width = 100;
|
|
||||||
documentation = true;
|
|
||||||
|
|
||||||
source = {
|
|
||||||
path = true;
|
|
||||||
buffer = true;
|
|
||||||
calc = true;
|
|
||||||
nvim_lsp = true;
|
|
||||||
nvim_lua = true;
|
|
||||||
vsnip = true;
|
|
||||||
ultisnips = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
local t = function(str)
|
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
local check_back_space = function()
|
|
||||||
local col = vim.fn.col('.') - 1
|
|
||||||
if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Use (s-)tab to:
|
|
||||||
--- move to prev/next item in completion menuone
|
|
||||||
--- jump to prev/next snippet's placeholder
|
|
||||||
_G.tab_complete = function()
|
|
||||||
if vim.fn.pumvisible() == 1 then
|
|
||||||
return t "<C-n>"
|
|
||||||
elseif vim.fn.call("vsnip#available", {1}) == 1 then
|
|
||||||
return t "<Plug>(vsnip-expand-or-jump)"
|
|
||||||
elseif check_back_space() then
|
|
||||||
return t "<Tab>"
|
|
||||||
else
|
|
||||||
return vim.fn['compe#complete']()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
_G.s_tab_complete = function()
|
|
||||||
if vim.fn.pumvisible() == 1 then
|
|
||||||
return t "<C-p>"
|
|
||||||
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
|
||||||
return t "<Plug>(vsnip-jump-prev)"
|
|
||||||
else
|
|
||||||
return t "<S-Tab>"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
|
||||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
|
||||||
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
|
||||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
|
||||||
|
|
||||||
|
|
||||||
-- lualine Config
|
-- lualine Config
|
||||||
require'lualine'.setup {
|
require'lualine'.setup {
|
||||||
|
|
1
.paodarc
1
.paodarc
|
@ -12,6 +12,7 @@ alias vim="nvim"
|
||||||
alias find="fd"
|
alias find="fd"
|
||||||
alias grep="rg"
|
alias grep="rg"
|
||||||
alias open="xdg-open"
|
alias open="xdg-open"
|
||||||
|
alias zigup="zigup --path-link /home/paoda/.local/bin/zig --install-dir /opt/zigup/zig"
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
dotfile() {
|
dotfile() {
|
||||||
|
|
8
.zshenv
8
.zshenv
|
@ -3,16 +3,20 @@ export DENO_INSTALL="/home/paoda/.deno"
|
||||||
export PATH="$DENO_INSTALL/bin:$PATH"
|
export PATH="$DENO_INSTALL/bin:$PATH"
|
||||||
|
|
||||||
# Set Default Editor
|
# Set Default Editor
|
||||||
export EDITOR="/usr/bin/nvim"
|
export EDITOR="/usr/bin/hx"
|
||||||
|
|
||||||
# Add ~/.local/bin to PATH
|
# Add ~/.local/bin to PATH
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
# zigup
|
||||||
|
export PATH="/opt/zigup/bin:$PATH"
|
||||||
|
|
||||||
# Zig language Server
|
# Zig language Server
|
||||||
export PATH="/opt/zls/bin:$PATH"
|
export PATH="/opt/zls/bin:$PATH"
|
||||||
|
|
||||||
# Rust
|
# Rust
|
||||||
source "$HOME/.cargo/env"
|
. "$HOME/.cargo/env"
|
||||||
|
|
||||||
# Yarn Global
|
# Yarn Global
|
||||||
export PATH="$HOME/.yarn/bin:$PATH"
|
export PATH="$HOME/.yarn/bin:$PATH"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue