FULL LUA! plus some bugfixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[user]
|
[user]
|
||||||
name = Jacob Bohanon
|
name = Jacob Bohanon
|
||||||
email = jacobbohanon@gmail.com
|
email = jacob.bohanon@solo.io
|
||||||
[url "ssh://git@github.com/"]
|
[url "ssh://git@github.com/"]
|
||||||
insteadOf = https://github.com/
|
insteadOf = https://github.com/
|
||||||
[tag]
|
[tag]
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
require("autocmd")
|
||||||
require("sets")
|
require("sets")
|
||||||
require("plugins")
|
require("plugins")
|
||||||
require("keymaps")
|
require("keymaps")
|
||||||
require("lsp")
|
require("lsp")
|
||||||
require("theme")
|
require("theme")
|
||||||
|
|
||||||
vim.cmd("source ~/.config/nvim/not_init.vim")
|
|
||||||
|
|||||||
11
nvim/lua/autocmd.lua
Normal file
11
nvim/lua/autocmd.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
vim.api.nvim_create_augroup('jbohanon', {clear=true})
|
||||||
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
|
pattern = '*',
|
||||||
|
group = 'jbohanon',
|
||||||
|
command = '%s/\\s\\+$//e',
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = {'yaml','cpp'},
|
||||||
|
group = 'jbohanon',
|
||||||
|
command = 'setlocal tabstop=2 softtabstop=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:>',
|
||||||
|
})
|
||||||
@@ -39,3 +39,9 @@ tnoremap('<Esc>', '<c-\\><c-n>')
|
|||||||
|
|
||||||
vnoremap('J', ':m \'>+1<CR>gv=gv')
|
vnoremap('J', ':m \'>+1<CR>gv=gv')
|
||||||
vnoremap('K', ':m \'<-2<CR>gv=gv')
|
vnoremap('K', ':m \'<-2<CR>gv=gv')
|
||||||
|
|
||||||
|
nnoremap('<Leader>ee', ':NvimTreeFindFileToggle<cr>')
|
||||||
|
vnoremap('<Leader>/', ':Commentary<cr>')
|
||||||
|
|
||||||
|
-- golang error handling
|
||||||
|
nnoremap('<Leader>err', 'oif err != nil {<CR>return nil, err<CR>}<CR><esc>kkI<esc>')
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ local on_attach = function(client, bufnr)
|
|||||||
vim.keymap.set('n', 'gd', require'telescope.builtin'.lsp_definitions, bufopts)
|
vim.keymap.set('n', 'gd', require'telescope.builtin'.lsp_definitions, bufopts)
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
vim.keymap.set('n', 'gi', require'telescope.builtin'.lsp_implementations, bufopts)
|
vim.keymap.set('n', 'gi', require'telescope.builtin'.lsp_implementations, bufopts)
|
||||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
vim.keymap.set('n', '<C-s>', vim.lsp.buf.signature_help, bufopts)
|
||||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
|
|||||||
2
nvim/lua/plugins/airline.lua
Normal file
2
nvim/lua/plugins/airline.lua
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
vim.g["airline#extensions#tabline#enabled"] = 1
|
||||||
|
vim.g.airline_powerline_fonts = 1
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
local map = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
|
local noremap = function(ctx, keys, cmd, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
opts['noremap'] = true
|
||||||
|
opts['silent'] = true
|
||||||
|
map(ctx, keys, cmd, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
local nnoremap = function(keys, cmd)
|
||||||
|
noremap('n', keys, cmd, nil)
|
||||||
|
end
|
||||||
|
local tnoremap = function(keys, cmd)
|
||||||
|
noremap('t', keys, cmd, nil)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.floaterm_wintype = 'split'
|
||||||
|
vim.g.floaterm_height = 0.2
|
||||||
|
nnoremap('<F7>', ':FloatermNew<CR>')
|
||||||
|
tnoremap('<F7>', '<C-\\><C-n>:FloatermNew<CR>')
|
||||||
|
nnoremap('<F8>', ':FloatermPrev<CR>')
|
||||||
|
tnoremap('<F8>', '<C-\\><C-n>:FloatermPrev<CR>')
|
||||||
|
nnoremap('<F9>', ':FloatermNext<CR>')
|
||||||
|
tnoremap('<F9>', '<C-\\><C-n>:FloatermNext<CR>')
|
||||||
|
nnoremap('<F12>', ':FloatermToggle<CR>')
|
||||||
|
tnoremap('<F12>', '<C-\\><C-n>:FloatermToggle<CR>')
|
||||||
|
|||||||
@@ -58,8 +58,10 @@ Plug 'tpope/vim-dispatch'
|
|||||||
|
|
||||||
vim.call('plug#end')
|
vim.call('plug#end')
|
||||||
|
|
||||||
|
require("plugins/airline")
|
||||||
require("plugins/floaterm")
|
require("plugins/floaterm")
|
||||||
require("plugins/harpoon")
|
require("plugins/harpoon")
|
||||||
require("plugins/telescope")
|
require("plugins/telescope")
|
||||||
require("plugins/treesitter")
|
require("plugins/treesitter")
|
||||||
require("plugins/nvim-cmp")
|
require("plugins/nvim-cmp")
|
||||||
|
require("plugins/vim-go")
|
||||||
|
|||||||
@@ -14,10 +14,8 @@ cmp.setup({
|
|||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
-- elseif has_words_before() then
|
||||||
luasnip.expand_or_jump()
|
-- cmp.complete()
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
@@ -25,8 +23,6 @@ cmp.setup({
|
|||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
@@ -35,7 +31,7 @@ cmp.setup({
|
|||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
['<C-e>'] = cmp.mapping.abort(),
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
|
|||||||
8
nvim/lua/plugins/vim-go.lua
Normal file
8
nvim/lua/plugins/vim-go.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
vim.g.go_highlight_fields = 1
|
||||||
|
vim.g.go_highlight_functions = 1
|
||||||
|
vim.g.go_highlight_function_calls = 1
|
||||||
|
vim.g.go_highlight_extra_types = 1
|
||||||
|
vim.g.go_highlight_operators = 1
|
||||||
|
vim.g.go_fmt_autosave = 1
|
||||||
|
vim.g.go_fmt_command = 'goimports'
|
||||||
|
vim.g.go_auto_type_info = 1
|
||||||
@@ -25,3 +25,5 @@ vim.api.nvim_set_option('backup', false)
|
|||||||
vim.api.nvim_set_option('undofile', true)
|
vim.api.nvim_set_option('undofile', true)
|
||||||
vim.api.nvim_set_option('undodir', vim.fn.expand('~')..'/.vim/undodir')
|
vim.api.nvim_set_option('undodir', vim.fn.expand('~')..'/.vim/undodir')
|
||||||
|
|
||||||
|
-- Completion config
|
||||||
|
vim.api.nvim_set_option('completeopt', 'menu,menuone,noselect,noinsert,preview')
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
vim.api.nvim_set_option('laststatus', 2)
|
||||||
|
vim.cmd('colorscheme gruvbox')
|
||||||
local themegroup = vim.api.nvim_create_augroup('themegroup', { clear = true })
|
local themegroup = vim.api.nvim_create_augroup('themegroup', { clear = true })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('ColorScheme', {
|
vim.api.nvim_create_autocmd('ColorScheme', {
|
||||||
|
|||||||
@@ -1,324 +0,0 @@
|
|||||||
" imap jj <Esc>
|
|
||||||
|
|
||||||
" set number
|
|
||||||
" set relativenumber
|
|
||||||
" set tabstop=4 softtabstop=4
|
|
||||||
" set shiftwidth=4
|
|
||||||
" set expandtab
|
|
||||||
" set smartindent
|
|
||||||
" set nohlsearch
|
|
||||||
" set hidden
|
|
||||||
" set noerrorbells
|
|
||||||
" set nowrap
|
|
||||||
" set noswapfile
|
|
||||||
" set nobackup
|
|
||||||
" set undodir=~/.vim/undodir
|
|
||||||
" set undofile
|
|
||||||
" set incsearch
|
|
||||||
" set termguicolors
|
|
||||||
" set scrolloff=8
|
|
||||||
" set colorcolumn=80,120
|
|
||||||
" set signcolumn=yes
|
|
||||||
" set cmdheight=2
|
|
||||||
" set notitle
|
|
||||||
" set updatetime=50
|
|
||||||
" au ColorScheme * hi Normal guibg=none ctermbg=none
|
|
||||||
" au ColorScheme * hi NonText guibg=none ctermbg=none
|
|
||||||
|
|
||||||
" call plug#begin('~/.vim/plugged')
|
|
||||||
|
|
||||||
" Plug 'voldikss/vim-floaterm'
|
|
||||||
" Plug 'mbbill/undotree'
|
|
||||||
" Plug 'wellle/context.vim'
|
|
||||||
|
|
||||||
" Plug 'tpope/vim-fugitive'
|
|
||||||
" Plug 'tpope/vim-commentary'
|
|
||||||
" Plug 'tpope/vim-surround'
|
|
||||||
|
|
||||||
" Plug 'f-person/git-blame.nvim'
|
|
||||||
|
|
||||||
" Plug 'gruvbox-community/gruvbox'
|
|
||||||
|
|
||||||
" Plug 'nvim-lua/plenary.nvim'
|
|
||||||
" Plug 'ThePrimeagen/harpoon'
|
|
||||||
|
|
||||||
" Plug 'BurntSushi/ripgrep'
|
|
||||||
|
|
||||||
" Plug 'sharkdp/fd'
|
|
||||||
|
|
||||||
" Plug 'nvim-treesitter/nvim-treesitter'
|
|
||||||
|
|
||||||
" Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
|
|
||||||
|
|
||||||
" Plug 'nvim-telescope/telescope.nvim'
|
|
||||||
|
|
||||||
" Plug 'airblade/vim-gitgutter'
|
|
||||||
|
|
||||||
" Plug 'liuchengxu/vista.vim'
|
|
||||||
|
|
||||||
" " Completion
|
|
||||||
" Plug 'neovim/nvim-lspconfig'
|
|
||||||
" Plug 'hrsh7th/cmp-nvim-lsp'
|
|
||||||
" Plug 'hrsh7th/cmp-buffer'
|
|
||||||
" Plug 'hrsh7th/cmp-path'
|
|
||||||
" Plug 'hrsh7th/cmp-cmdline'
|
|
||||||
" Plug 'hrsh7th/nvim-cmp'
|
|
||||||
|
|
||||||
" " For vsnip users.
|
|
||||||
" Plug 'hrsh7th/cmp-vsnip'
|
|
||||||
" Plug 'hrsh7th/vim-vsnip'
|
|
||||||
|
|
||||||
" " Go plugins
|
|
||||||
" Plug 'fatih/vim-go'
|
|
||||||
" Plug 'Shougo/neocomplete.vim'
|
|
||||||
|
|
||||||
" Plug 'majutsushi/tagbar'
|
|
||||||
|
|
||||||
" Plug 'vim-airline/vim-airline'
|
|
||||||
" Plug 'vim-airline/vim-airline-themes'
|
|
||||||
" Plug 'kyazdani42/nvim-web-devicons'
|
|
||||||
" Plug 'kyazdani42/nvim-tree.lua'
|
|
||||||
" Plug 'ellisonleao/glow.nvim', {'branch': 'main'}
|
|
||||||
" Plug 'tpope/vim-dispatch'
|
|
||||||
" call plug#end()
|
|
||||||
|
|
||||||
let $GINKGO_EDITOR_INTEGRATION = "true"
|
|
||||||
|
|
||||||
" lua require('nvim-tree').setup()
|
|
||||||
|
|
||||||
" set foldmethod=expr
|
|
||||||
" set foldexpr=nvim_treesitter#foldexpr()
|
|
||||||
" set nofoldenable " Disable folding at startup.
|
|
||||||
" nnoremap zz za<CR>
|
|
||||||
" nnoremap ZZ zA<CR>
|
|
||||||
|
|
||||||
" Find files using Telescope command-line sugar.
|
|
||||||
" let mapleader = \" \"
|
|
||||||
" nnoremap <Leader>ff <cmd>lua require('telescope.builtin').find_files({hidden = true, file_ignore_patterns = {"^.git"}})<cr>
|
|
||||||
" nnoremap <Leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>
|
|
||||||
" nnoremap <Leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>
|
|
||||||
" nnoremap <Leader>ft <cmd>lua require('telescope.builtin').grep_string()<cr>
|
|
||||||
" nnoremap <Leader>fh <cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>
|
|
||||||
" nnoremap <Leader>tr <cmd>lua require('telescope.builtin').treesitter()<cr>
|
|
||||||
|
|
||||||
nnoremap <Leader>err oif err != nil {<CR>return nil, err<CR>}<CR><esc>kkI<esc>
|
|
||||||
|
|
||||||
" nnoremap <Leader>q :bp\|bd #<CR>
|
|
||||||
" nnoremap <Leader>w :w<CR>
|
|
||||||
" nnoremap <Leader>n :bn<CR>
|
|
||||||
" nnoremap <Leader>b :bp<CR>
|
|
||||||
" nnoremap <Leader>1 <cmd>lua require("harpoon.ui").nav_file(1)<CR>
|
|
||||||
" nnoremap <Leader>2 <cmd>lua require("harpoon.ui").nav_file(2)<CR>
|
|
||||||
" nnoremap <Leader>3 <cmd>lua require("harpoon.ui").nav_file(3)<CR>
|
|
||||||
" nnoremap <Leader>4 <cmd>lua require("harpoon.ui").nav_file(4)<CR>
|
|
||||||
" nnoremap <Leader>5 <cmd>lua require("harpoon.ui").nav_file(5)<CR>
|
|
||||||
" nnoremap <Leader>6 <cmd>lua require("harpoon.ui").nav_file(6)<CR>
|
|
||||||
" nnoremap <Leader>7 <cmd>lua require("harpoon.ui").nav_file(7)<CR>
|
|
||||||
" nnoremap <Leader>8 <cmd>lua require("harpoon.ui").nav_file(8)<CR>
|
|
||||||
" nnoremap <Leader>9 <cmd>lua require("harpoon.ui").nav_file(9)<CR>
|
|
||||||
" nnoremap <c-j> <c-w><c-j>
|
|
||||||
" nnoremap <c-k> <c-w><c-k>
|
|
||||||
" nnoremap <c-h> <c-w><c-h>
|
|
||||||
" nnoremap <c-l> <c-w><c-l>
|
|
||||||
" tnoremap <c-j> <c-\><c-n><c-w><c-j>
|
|
||||||
" tnoremap <c-k> <c-\><c-n><c-w><c-k>
|
|
||||||
" tnoremap <c-h> <c-\><c-n><c-w><c-h>
|
|
||||||
" tnoremap <c-l> <c-\><c-n><c-w><c-l>
|
|
||||||
" tnoremap <Esc> <C-\><C-n>
|
|
||||||
nnoremap <Leader>ee :NvimTreeFindFileToggle<cr>
|
|
||||||
" nnoremap <Leader>h <cmd>lua require("harpoon.mark").add_file()<cr>
|
|
||||||
nnoremap <Leader>/ :Commentary<cr>
|
|
||||||
vnoremap <Leader>/ :Commentary<cr>
|
|
||||||
|
|
||||||
" vnoremap J :m '>+1<CR>gv=gv
|
|
||||||
" vnoremap K :m '<-2<CR>gv=gv
|
|
||||||
|
|
||||||
let g:floaterm_wintype='split'
|
|
||||||
let g:floaterm_height=0.2
|
|
||||||
nnoremap <silent> <F7> :FloatermNew<CR>
|
|
||||||
tnoremap <silent> <F7> <C-\><C-n>:FloatermNew<CR>
|
|
||||||
nnoremap <silent> <F8> :FloatermPrev<CR>
|
|
||||||
tnoremap <silent> <F8> <C-\><C-n>:FloatermPrev<CR>
|
|
||||||
nnoremap <silent> <F9> :FloatermNext<CR>
|
|
||||||
tnoremap <silent> <F9> <C-\><C-n>:FloatermNext<CR>
|
|
||||||
nnoremap <silent> <F12> :FloatermToggle<CR>
|
|
||||||
tnoremap <silent> <F12> <C-\><C-n>:FloatermToggle<CR>
|
|
||||||
|
|
||||||
let mapleader = '\'
|
|
||||||
nnoremap <Leader><CR> :so ~/.config/nvim/init.lua<CR>
|
|
||||||
nnoremap <Leader><Leader> :e ~/.config/nvim/init.lua<CR>
|
|
||||||
let mapleader = ' '
|
|
||||||
|
|
||||||
augroup jbohanon
|
|
||||||
autocmd!
|
|
||||||
autocmd BufWritePre * %s/\s\+$//e
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
set laststatus=2
|
|
||||||
"set statusline=%{FugitiveStatusline()}
|
|
||||||
"set statusline+=\ %f
|
|
||||||
colorscheme gruvbox
|
|
||||||
|
|
||||||
" Go specific commands
|
|
||||||
filetype plugin indent on
|
|
||||||
set autowrite
|
|
||||||
" Go syntax highlighting
|
|
||||||
let g:go_highlight_fields = 1
|
|
||||||
let g:go_highlight_functions = 1
|
|
||||||
let g:go_highlight_function_calls = 1
|
|
||||||
let g:go_highlight_extra_types = 1
|
|
||||||
let g:go_highlight_operators = 1
|
|
||||||
" Auto formatting and importing
|
|
||||||
let g:go_fmt_autosave = 1
|
|
||||||
let g:go_fmt_command = "goimports"
|
|
||||||
" Status line types/signatures
|
|
||||||
let g:go_auto_type_info = 1
|
|
||||||
|
|
||||||
" Airline config
|
|
||||||
let g:airline#extensions#tabline#enabled = 1
|
|
||||||
let g:airline_powerline_fonts = 1
|
|
||||||
|
|
||||||
" Completion config
|
|
||||||
set completeopt=menu,menuone,noselect,noinsert,preview
|
|
||||||
|
|
||||||
" lua << EOF
|
|
||||||
" -- Mappings.
|
|
||||||
" -- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
|
||||||
" local opts = { noremap=true, silent=true }
|
|
||||||
" vim.keymap.set('n', '<space>d', vim.diagnostic.open_float, opts)
|
|
||||||
" vim.keymap.set('n', '<space>dd', require'telescope.builtin'.diagnostics, opts)
|
|
||||||
" vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
|
||||||
" vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
|
||||||
" vim.keymap.set('n', '<space>dl', vim.diagnostic.setloclist, opts)
|
|
||||||
|
|
||||||
" -- 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)
|
|
||||||
" -- Enable completion triggered by <c-x><c-o>
|
|
||||||
" vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
||||||
|
|
||||||
" -- Mappings.
|
|
||||||
" -- See `:help vim.lsp.*` for documentation on any of the below functions
|
|
||||||
" local bufopts = { noremap=true, silent=true, buffer=bufnr }
|
|
||||||
" --vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
|
||||||
" vim.keymap.set('n', 'gD', require'telescope.builtin'.lsp_type_definitions, bufopts)
|
|
||||||
" --vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
|
||||||
" vim.keymap.set('n', 'gd', require'telescope.builtin'.lsp_definitions, bufopts)
|
|
||||||
" vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
|
||||||
" vim.keymap.set('n', 'gi', require'telescope.builtin'.lsp_implementations, bufopts)
|
|
||||||
" vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
|
||||||
" vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
|
||||||
" vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
|
||||||
" vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
|
||||||
" --vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
|
||||||
" vim.keymap.set('n', 'gr', require'telescope.builtin'.lsp_references, bufopts)
|
|
||||||
" vim.keymap.set('n', '<space>f', vim.lsp.buf.format, bufopts)
|
|
||||||
" end
|
|
||||||
" local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
||||||
" require('lspconfig')['gopls'].setup{
|
|
||||||
" settings = {
|
|
||||||
" gopls = {
|
|
||||||
" templateExtensions = {'gotmpl', 'gohtml'},
|
|
||||||
" }
|
|
||||||
" },
|
|
||||||
" filetypes = { "go", "gomod", "gowork", "gotmpl", "gohtml", "gohtmltmpl" },
|
|
||||||
" on_attach = on_attach,
|
|
||||||
" capabilities = capabilities,
|
|
||||||
" }
|
|
||||||
" require('lspconfig')['pyright'].setup{
|
|
||||||
" on_attach = on_attach,
|
|
||||||
" capabilities = capabilities,
|
|
||||||
" }
|
|
||||||
" require('lspconfig')['tsserver'].setup{
|
|
||||||
" on_attach = on_attach,
|
|
||||||
" capabilities = capabilities,
|
|
||||||
" }
|
|
||||||
" require('lspconfig')['clangd'].setup{
|
|
||||||
" on_attach = on_attach,
|
|
||||||
" capabilities = capabilities,
|
|
||||||
" }
|
|
||||||
" require('lspconfig')['rust_analyzer'].setup{
|
|
||||||
" on_attach = on_attach,
|
|
||||||
" capabilities = capabilities,
|
|
||||||
" }
|
|
||||||
" require('lspconfig')['bashls'].setup{
|
|
||||||
" on_attach = on_attach,
|
|
||||||
" capabilities = capabilities,
|
|
||||||
" }
|
|
||||||
" EOF
|
|
||||||
|
|
||||||
" lua <<EOF
|
|
||||||
" local cmp = require'cmp'
|
|
||||||
|
|
||||||
" cmp.setup({
|
|
||||||
" snippet = {
|
|
||||||
" expand = function(args)
|
|
||||||
" vim.fn["vsnip#anonymous"](args.body)
|
|
||||||
" end,
|
|
||||||
" },
|
|
||||||
" window = {
|
|
||||||
" completion = cmp.config.window.bordered(),
|
|
||||||
" documentation = cmp.config.window.bordered(),
|
|
||||||
" },
|
|
||||||
" mapping = cmp.mapping.preset.insert({
|
|
||||||
" ["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
" if cmp.visible() then
|
|
||||||
" cmp.select_next_item()
|
|
||||||
" elseif luasnip.expand_or_jumpable() then
|
|
||||||
" luasnip.expand_or_jump()
|
|
||||||
" elseif has_words_before() then
|
|
||||||
" cmp.complete()
|
|
||||||
" else
|
|
||||||
" fallback()
|
|
||||||
" end
|
|
||||||
" end, { "i", "s" }),
|
|
||||||
" ["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
" if cmp.visible() then
|
|
||||||
" cmp.select_prev_item()
|
|
||||||
" elseif luasnip.jumpable(-1) then
|
|
||||||
" luasnip.jump(-1)
|
|
||||||
" else
|
|
||||||
" fallback()
|
|
||||||
" end
|
|
||||||
" end, { "i", "s" }),
|
|
||||||
" ['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
" ['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
" ['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
" ['<C-e>'] = cmp.mapping.abort(),
|
|
||||||
" ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
" }),
|
|
||||||
" sources = cmp.config.sources({
|
|
||||||
" { name = 'nvim_lsp' },
|
|
||||||
" { name = 'vsnip' },
|
|
||||||
" }, {
|
|
||||||
" { name = 'buffer' },
|
|
||||||
" })
|
|
||||||
" })
|
|
||||||
|
|
||||||
" -- Set configuration for specific filetype.
|
|
||||||
" cmp.setup.filetype('gitcommit', {
|
|
||||||
" sources = cmp.config.sources({
|
|
||||||
" { name = 'cmp_git' },
|
|
||||||
" }, {
|
|
||||||
" { name = 'buffer' },
|
|
||||||
" })
|
|
||||||
" })
|
|
||||||
|
|
||||||
" -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
|
||||||
" cmp.setup.cmdline('/', {
|
|
||||||
" mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
" sources = {
|
|
||||||
" { name = 'buffer' }
|
|
||||||
" }
|
|
||||||
" })
|
|
||||||
|
|
||||||
" -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
|
||||||
" cmp.setup.cmdline(':', {
|
|
||||||
" mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
" sources = cmp.config.sources({
|
|
||||||
" { name = 'path' }
|
|
||||||
" }, {
|
|
||||||
" { name = 'cmdline' }
|
|
||||||
" })
|
|
||||||
" })
|
|
||||||
" EOF
|
|
||||||
@@ -298,7 +298,7 @@ theme "dracula"
|
|||||||
// Path to the default editor to use to edit pane scrollbuffer
|
// Path to the default editor to use to edit pane scrollbuffer
|
||||||
// Default: $EDITOR or $VISUAL
|
// Default: $EDITOR or $VISUAL
|
||||||
//
|
//
|
||||||
// scrollback_editor "/usr/bin/vim"
|
scrollback_editor "/usr/bin/nvim"
|
||||||
|
|
||||||
// When attaching to an existing session with other users,
|
// When attaching to an existing session with other users,
|
||||||
// should the session be mirrored (true)
|
// should the session be mirrored (true)
|
||||||
|
|||||||
16
zsh/.zshrc
16
zsh/.zshrc
@@ -38,7 +38,6 @@ if [[ $(uname) == Linux ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
alias cls='clear'
|
alias cls='clear'
|
||||||
export PATH="/opt/homebrew/opt/protobuf@3.6/bin:$PATH"
|
|
||||||
|
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
@@ -55,18 +54,3 @@ export STARSHIP_CONFIG=~/.config/zsh/starship.toml
|
|||||||
|
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
|
||||||
# >>> conda initialize >>>
|
|
||||||
# !! Contents within this block are managed by 'conda init' !!
|
|
||||||
# __conda_setup="$('/usr/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
|
||||||
# if [ $? -eq 0 ]; then
|
|
||||||
# eval "$__conda_setup"
|
|
||||||
# else
|
|
||||||
# if [ -f "/usr/etc/profile.d/conda.sh" ]; then
|
|
||||||
# . "/usr/etc/profile.d/conda.sh"
|
|
||||||
# else
|
|
||||||
# export PATH="/usr/bin:$PATH"
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
# unset __conda_setup
|
|
||||||
# <<< conda initialize <<<
|
|
||||||
|
|
||||||
|
|||||||
4
zsh/config.d/90-envoy.zsh
Normal file
4
zsh/config.d/90-envoy.zsh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[ "$(which clang-format)" != "" ] && export CLANG_FORMAT=/opt/llvm/bin/clang-format || echo "WARNING: clang-format not installed. Required to push to envoy repo"
|
||||||
|
[ "$(which buildozer)" != "" ] && export BUILDOZER_BIN=$HOME/.go/go/bin/buildozer || echo "WARNING: buildozer not installed. Required to push to envoy repo"
|
||||||
|
([ "$(which buildifier)" != "" ] && export BUILDIFIER_BIN=$HOME/.go/go/bin/buildifier) || echo "WARNING: buildifier not installed. Required to push to envoy repo"
|
||||||
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Requires https://github.com/caarlos0/timer
|
|
||||||
# Requires spd-say
|
|
||||||
|
|
||||||
declare -A pomo_options
|
|
||||||
pomo_options["work"]="45"
|
|
||||||
pomo_options["break"]="10"
|
|
||||||
|
|
||||||
pomodoro () {
|
|
||||||
if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then
|
|
||||||
val=$1
|
|
||||||
echo $val
|
|
||||||
timer ${pomo_options["$val"]}m
|
|
||||||
spd-say "'$val' session done"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
alias wo="pomodoro 'work'"
|
|
||||||
alias br="pomodoro 'break'"
|
|
||||||
Reference in New Issue
Block a user