Compare commits
No commits in common. "e51198465e34c09ef7231ee433317180966bb9b4" and "bbfd9db3a6709341b5d921d91059e9d0b7de323c" have entirely different histories.
e51198465e
...
bbfd9db3a6
|
@ -30,8 +30,6 @@ Plug 'glepnir/dashboard-nvim'
|
|||
|
||||
Plug 'hoob3rt/lualine.nvim'
|
||||
|
||||
Plug 'ziglang/zig.vim'
|
||||
|
||||
Plug 'simrat39/rust-tools.nvim'
|
||||
" One Dark Pro
|
||||
Plug 'joshdick/onedark.vim'
|
||||
|
@ -42,10 +40,7 @@ Plug 'joshdick/onedark.vim'
|
|||
Plug 'mfussenegger/nvim-dap'
|
||||
|
||||
" Autocomplete
|
||||
Plug 'nvim-lua/completion-nvim'
|
||||
Plug 'steelsojka/completion-buffers'
|
||||
Plug 'nvim-treesitter/completion-treesitter'
|
||||
Plug 'kristijanhusak/completion-tags'
|
||||
Plug 'hrsh7th/nvim-compe'
|
||||
Plug 'hrsh7th/vim-vsnip'
|
||||
Plug 'hrsh7th/vim-vsnip-integ'
|
||||
|
||||
|
@ -60,29 +55,20 @@ Plug 'romgrk/barbar.nvim'
|
|||
|
||||
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--
|
||||
nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>
|
||||
nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>
|
||||
nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<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
|
||||
" nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
|
||||
" nnoremap <silent> <localleader> :<c-u>WhichKey ','<CR>
|
||||
|
@ -162,55 +148,22 @@ highlight NvimTreeFolderIcon guibg=blue
|
|||
colorscheme onedark
|
||||
|
||||
lua << EOF
|
||||
|
||||
-- NVIM 0.5 LSP Setup
|
||||
|
||||
-- nvim lspconfig
|
||||
local nvim_lsp = require('lspconfig')
|
||||
local nvim_lsp = require'lspconfig'
|
||||
nvim_lsp.pyright.setup{}
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||
|
||||
--Enable completion triggered by <c-x><c-o>
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings.
|
||||
local opts = { noremap=true, silent=true }
|
||||
vim.api.nvim_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>d', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
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)
|
||||
|
||||
-- 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
|
||||
require'rust-tools'.setup{
|
||||
|
@ -239,50 +192,19 @@ require'nvim-treesitter.configs'.setup {
|
|||
}
|
||||
|
||||
-- Telescope Defaults
|
||||
require('telescope').setup{
|
||||
require'telescope'.setup {
|
||||
defaults = {
|
||||
vimgrep_arguments = {
|
||||
'rg',
|
||||
'--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,
|
||||
find_command = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'},
|
||||
prompt_position = "bottom",
|
||||
prompt_prefix = " ",
|
||||
border = {},
|
||||
borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'},
|
||||
color_devicons = true,
|
||||
use_less = true,
|
||||
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,
|
||||
set_env = {['COLORTERM'] = 'truecolor'},
|
||||
},
|
||||
}
|
||||
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker
|
||||
}
|
||||
}
|
||||
-- Barbar Keybinds
|
||||
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 })
|
||||
|
@ -295,6 +217,75 @@ require'nvim-autopairs'.setup()
|
|||
require'nvim_comment'.setup()
|
||||
|
||||
-- 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
|
||||
require'lualine'.setup {
|
||||
|
|
1
.paodarc
1
.paodarc
|
@ -12,7 +12,6 @@ alias vim="nvim"
|
|||
alias find="fd"
|
||||
alias grep="rg"
|
||||
alias open="xdg-open"
|
||||
alias zigup="zigup --path-link /home/paoda/.local/bin/zig --install-dir /opt/zigup/zig"
|
||||
|
||||
# Functions
|
||||
dotfile() {
|
||||
|
|
8
.zshenv
8
.zshenv
|
@ -3,20 +3,16 @@ export DENO_INSTALL="/home/paoda/.deno"
|
|||
export PATH="$DENO_INSTALL/bin:$PATH"
|
||||
|
||||
# Set Default Editor
|
||||
export EDITOR="/usr/bin/hx"
|
||||
export EDITOR="/usr/bin/nvim"
|
||||
|
||||
# Add ~/.local/bin to PATH
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
# zigup
|
||||
export PATH="/opt/zigup/bin:$PATH"
|
||||
|
||||
# Zig language Server
|
||||
export PATH="/opt/zls/bin:$PATH"
|
||||
|
||||
# Rust
|
||||
. "$HOME/.cargo/env"
|
||||
source "$HOME/.cargo/env"
|
||||
|
||||
# Yarn Global
|
||||
export PATH="$HOME/.yarn/bin:$PATH"
|
||||
|
||||
|
|
Loading…
Reference in New Issue