Configure for .stowrc
This commit is contained in:
parent
e58bb4c0a0
commit
1091129506
132 changed files with 4 additions and 18 deletions
342
slackware/home/nvim/.config/nvim/init.vim
Normal file
342
slackware/home/nvim/.config/nvim/init.vim
Normal file
|
|
@ -0,0 +1,342 @@
|
|||
" vim-plug {{{
|
||||
" Automatic installation
|
||||
if empty(glob('~/.vim/autoload/plug.vim'))
|
||||
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
||||
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||
endif
|
||||
|
||||
call plug#begin('~/.nvim/plugins')
|
||||
packloadall
|
||||
|
||||
Plug 'chriskempson/base16-vim'
|
||||
Plug 'junegunn/vim-easy-align'
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin --all' }
|
||||
" Plug 'https://gitlab.com/lstwn/broot.vim'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'tpope/vim-commentary'
|
||||
" Plug 'dense-analysis/ale'
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
" Plug 'itchyny/lightline.vim'
|
||||
Plug 'tpope/vim-repeat'
|
||||
" Plug 'haya14busa/incsearch.vim'
|
||||
Plug 'sheerun/vim-polyglot'
|
||||
" Plug 'nvie/vim-flake8'
|
||||
" Plug 'wolf-dog/lightline-sceaduhelm.vim'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'justinmk/vim-sneak'
|
||||
Plug 'jgdavey/tslime.vim'
|
||||
Plug 'vimwiki/vimwiki'
|
||||
Plug 'simnalamburt/vim-mundo'
|
||||
Plug 'tpope/vim-dadbod'
|
||||
Plug 'junegunn/gv.vim'
|
||||
Plug 'rbong/vim-flog'
|
||||
Plug 'tpope/vim-unimpaired'
|
||||
Plug 'guns/vim-clojure-static' " syntax
|
||||
Plug 'tpope/vim-fireplace'
|
||||
Plug 'guns/vim-sexp'
|
||||
Plug 'tpope/vim-sexp-mappings-for-regular-people'
|
||||
Plug 'alvan/vim-closetag'
|
||||
Plug 'mattn/emmet-vim'
|
||||
Plug 'chrisbra/colorizer'
|
||||
Plug 'christoomey/vim-tmux-navigator'
|
||||
Plug 'tpope/vim-rhubarb'
|
||||
Plug 'zhaozg/vim-diagram'
|
||||
Plug 'fatih/vim-go'
|
||||
Plug 'diepm/vim-rest-console'
|
||||
Plug 'pangloss/vim-javascript'
|
||||
Plug 'leafgarland/typescript-vim'
|
||||
Plug 'MaxMEllon/vim-jsx-pretty'
|
||||
Plug 'peitalin/vim-jsx-typescript'
|
||||
Plug 'jremmen/vim-ripgrep'
|
||||
Plug 'francoiscabrol/ranger.vim'
|
||||
" Plug 'https://github.com/moll/vim-bbye'
|
||||
Plug 'jlanzarotta/bufexplorer'
|
||||
Plug 'dbeniamine/cheat.sh-vim'
|
||||
Plug 'skyuplam/broot.nvim'
|
||||
Plug 'rbgrouleff/bclose.vim'
|
||||
|
||||
call plug#end()
|
||||
|
||||
"}}}
|
||||
|
||||
" unmaps {{{
|
||||
let g:bclose_no_plugin_maps=1
|
||||
" }}}
|
||||
|
||||
" appearance {{{
|
||||
syntax on " Enable syntax
|
||||
set encoding=utf-8 " Keep utf-8 encoding
|
||||
set scrolloff=2 " Keep at least 3 lines above and below cursor
|
||||
set showmode " Something something buffers
|
||||
set showcmd " Show command in bottom bar
|
||||
set wildmenu " Visual autocomplete for command menu
|
||||
set wildmode=list:longest " Show all completions on tab
|
||||
set laststatus=2 " Last window will always have statusline
|
||||
set showmatch " Highlight matching [{()}]
|
||||
set cursorline " Highlight current line
|
||||
highlight GitGutterAdd ctermbg=black guibg=black
|
||||
highlight SignColumn guibg=black ctermbg=black
|
||||
let g:ctrlsf_default_root="project"
|
||||
" remove underline on current line number
|
||||
hi CursorLineNr cterm=bold
|
||||
|
||||
hi StatusLine ctermbg=Black
|
||||
hi WinSeparator guibg=None
|
||||
|
||||
" " Lightline
|
||||
" let g:lightline = { 'colorscheme': 'sceaduhelm' }
|
||||
" set fillchars+=vert:│
|
||||
|
||||
" command! LightlineReload call LightlineReload()
|
||||
|
||||
" function! LightlineReload()
|
||||
" call lightline#init()
|
||||
" call lightline#colorscheme()
|
||||
" call lightline#update()
|
||||
" endfunction
|
||||
|
||||
" Invisible characters
|
||||
set list
|
||||
set listchars=tab:▸\ ,eol:¬
|
||||
|
||||
set laststatus=3
|
||||
|
||||
" }}}
|
||||
|
||||
" Folding {{{
|
||||
set foldenable " Enable folding
|
||||
set foldmethod=marker " Fold sections by marker
|
||||
set foldlevel=0 " Fold by default
|
||||
set modelines=1 " Check final line of file for modeline
|
||||
|
||||
" }}}
|
||||
|
||||
" behavior {{{
|
||||
set nocompatible " Turn off vi compatability nonsense
|
||||
set hidden " Hide buffer when opening new file
|
||||
set visualbell " Use visual bell instead of beeping
|
||||
set ttyfast " Improves smoothness and drawing
|
||||
set backspace=indent,eol,start " Always allow backspacing
|
||||
set undofile " Make .un file for persistent undo
|
||||
set number
|
||||
set lazyredraw " Redraw only when necessary
|
||||
set updatetime=100 " Make updates happen faster (gitgutter)
|
||||
set splitright " Make split to right by default
|
||||
set splitbelow
|
||||
set winheight=30 " Soft minimum window height (active)
|
||||
set winminheight=6 " Hard minimum window height (inactive)
|
||||
set winwidth=90 " Window width for current window
|
||||
set winminwidth=30 " Hard minimum for window width
|
||||
set t_vb= " No visual bell ever
|
||||
let g:sneak#use_ic_scs=1
|
||||
set virtualedit=block
|
||||
set noswapfile
|
||||
set undodir=~/.nvim/undo
|
||||
let g:markdown_folding=1
|
||||
au FileType markdown setlocal foldlevel=99
|
||||
let g:bufExplorerSplitHorzSize=8 " New split window is n rows high.
|
||||
let g:bufExplorerDefaultHelp=0 " Do not show default help.
|
||||
|
||||
"}}}
|
||||
|
||||
" searching {{{
|
||||
set gdefault " Remove default g flag on search
|
||||
set ignorecase " Ignore case for searches
|
||||
set smartcase " Case-specific only when uppercase
|
||||
set hlsearch " Don't continue to highlight searched phrases.
|
||||
set incsearch " But do search as characters are entered
|
||||
|
||||
"}}}
|
||||
|
||||
" tab settings {{{
|
||||
set tabstop=4 " Number of visual spaces per tab
|
||||
set softtabstop=4 " Should always = tabstop
|
||||
set shiftwidth=4 " Indent/outdent by 4 columns
|
||||
set expandtab " Tabs are spaces
|
||||
set shiftround " Always indent/outdent to the nearest tabstop
|
||||
" Make search terms more visible
|
||||
highlight Visual ctermbg=DarkGreen ctermfg=Black
|
||||
set autoindent " Auto indentation
|
||||
|
||||
"}}}
|
||||
|
||||
" hjkl {{{
|
||||
" Disable arrow keys in normal and visual mode
|
||||
nnoremap <up> <nop>
|
||||
nnoremap <down> <nop>
|
||||
nnoremap <left> <nop>
|
||||
nnoremap <right> <nop>
|
||||
inoremap <up> <nop>
|
||||
inoremap <down> <nop>
|
||||
inoremap <left> <nop>
|
||||
inoremap <right> <nop>
|
||||
" Make j and k move by screen line, not file line
|
||||
nnoremap j gj
|
||||
nnoremap k gk
|
||||
|
||||
"}}}
|
||||
|
||||
" {{{ web dev
|
||||
autocmd FileType html,css,javascript,typescript,typescriptreact
|
||||
\ set expandtab smarttab softtabstop=2 shiftwidth=2 tabstop=2
|
||||
|
||||
" Emmet tab size
|
||||
let g:user_emmet_settings = {
|
||||
\ 'indentation' : ' '
|
||||
\}
|
||||
|
||||
" }}}
|
||||
|
||||
" split pane navigation {{{
|
||||
" nnoremap <C-h> <C-w>h
|
||||
" nnoremap <C-j> <C-w>j
|
||||
" nnoremap <C-k> <C-w>k
|
||||
" nnoremap <C-l> <C-w>l
|
||||
nnoremap <C-c> :close <cr>
|
||||
nnoremap <C-n> :bn <cr>
|
||||
nnoremap <C-p> :bp <cr>
|
||||
let g:tmux_navigator_disable_when_zoomed = 1
|
||||
|
||||
"}}}
|
||||
|
||||
" git commands {{{
|
||||
nmap ghv <Plug>(GitGutterPreviewHunk)
|
||||
nmap ghn <Plug>(GitGutterNextHunk)
|
||||
nmap ghp <Plug>(GitGutterPrevHunk)
|
||||
nmap ghf <Plug>(GitGutterFold)
|
||||
nmap ghs <Plug>(GitGutterStageHunk)
|
||||
" Controls fugitive diff split direction
|
||||
set diffopt=vertical
|
||||
"}}}
|
||||
|
||||
" plugin modification {{{
|
||||
" FZF
|
||||
map <C-s> :FZF<cr>
|
||||
" map <C-s> :tabNext<cr>
|
||||
" This is the default extra key bindings
|
||||
let g:fzf_action = {
|
||||
\ 'ctrl-t': 'tab split',
|
||||
\ 'ctrl-x': 'split',
|
||||
\ 'ctrl-v': 'vsplit' }
|
||||
|
||||
" Default fzf layout
|
||||
" - down / up / left / right
|
||||
let g:fzf_layout = { 'down': '~30%' }
|
||||
|
||||
" Customize fzf colors to match your color scheme
|
||||
let g:fzf_colors =
|
||||
\ { 'fg': [ 'fg', 'Normal'],
|
||||
\ 'bg': [ 'bg', 'Normal'],
|
||||
\ 'hl': [ 'fg', 'Comment'],
|
||||
\ 'fg+': [ 'fg', 'CursorLine', 'CursorColumn', 'Normal'],
|
||||
\ 'bg+': [ 'bg', 'CursorLine', 'CursorColumn'],
|
||||
\ 'hl+': [ 'fg', 'Statement'],
|
||||
\ 'info': [ 'fg', 'PreProc'],
|
||||
\ 'border': [ 'fg', 'Ignore'],
|
||||
\ 'prompt': [ 'fg', 'Conditional'],
|
||||
\ 'pointer': [ 'fg', 'Exception'],
|
||||
\ 'marker': [ 'fg', 'Keyword'],
|
||||
\ 'spinner': [ 'fg', 'Label'],
|
||||
\ 'header': [ 'fg', 'Comment'] }
|
||||
|
||||
" EasyAlign
|
||||
"" Start interactive EasyAlign in visual mode (e.g. vipga)
|
||||
xmap ga <Plug>(EasyAlign)
|
||||
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
||||
nmap ga <Plug>(EasyAlign)
|
||||
|
||||
"}}}
|
||||
|
||||
" vimwiki {{{
|
||||
let g:vimwiki_list = [
|
||||
\ {'name': 'work', 'path': '~/.vim/work'},
|
||||
\ {'name': 'home', 'path': '~/.vim/home'},
|
||||
\ {'name': 'blog', 'path': '~/.vim/blog'},
|
||||
\ {'name': 'vim', 'path': '~/.vim/vim'},
|
||||
\ ]
|
||||
|
||||
|
||||
let g:vimwiki_syntax = 'markdown'
|
||||
let g:vimwiki_ext = '.md'
|
||||
|
||||
let g:vimwiki_automatic_nested_syntaxes = 1
|
||||
let g:vimwiki_links_space_char = '_'
|
||||
|
||||
"}}}
|
||||
|
||||
" diffs {{{
|
||||
hi DiffAdd cterm=none ctermfg=DarkGray ctermbg=Green
|
||||
hi DiffChange cterm=none ctermfg=DarkGray ctermbg=Yellow
|
||||
hi DiffDelete cterm=bold ctermfg=DarkGray ctermbg=Red
|
||||
hi DiffText cterm=none ctermfg=DarkGray ctermbg=LightBlue
|
||||
|
||||
" better diffs
|
||||
set diffopt+=internal,algorithm:patience
|
||||
|
||||
" }}}
|
||||
|
||||
" buffers {{{
|
||||
let g:bufExplorerDisableDefaultKeyMapping=1 " Disable mapping.
|
||||
"}}}
|
||||
|
||||
" broot {{{
|
||||
" let g:broot_default_conf_path=expand('~/.config/broot/conf.hjson')
|
||||
" let g:broot_replace_netrw=1
|
||||
" let g:loaded_netrwPlugin=1 " use broot for :E/T/V/Hexplore
|
||||
"}}}
|
||||
|
||||
"" ALE {{{
|
||||
" let g:ale_linters = {'javascript': ['tsserver'],
|
||||
" \ 'typescript': ['tsserver'],
|
||||
" \ 'typescriptreact': ['tsserver'],
|
||||
" \ 'python': ['flake8'],
|
||||
" \ 'css': ['csslint'],
|
||||
" \ 'dockerfile': ['hadolint'],
|
||||
" \ 'yaml': ['yamllint'] }
|
||||
|
||||
" let g:ale_fixers = {
|
||||
" \ '*': ['remove_trailing_lines', 'trim_whitespace'] }
|
||||
|
||||
" " let g:ale_set_loclist = 0
|
||||
" " let g:ale_set_quickfix = 1
|
||||
" let g:ale_set_quickfix = 0
|
||||
" let g:ale_set_loclist = 0
|
||||
" let g:ale_fix_on_save = 1
|
||||
|
||||
""}}}
|
||||
|
||||
" leaders {{{
|
||||
:let mapleader = ","
|
||||
|
||||
" Underline with line of the same length
|
||||
nnoremap <leader>- yypv$r-
|
||||
|
||||
" Insert date on current line
|
||||
nnoremap <leader>d k :r !date <cr>
|
||||
|
||||
nnoremap <leader>se :Explore<cr>
|
||||
nnoremap <leader>st :Texplore<cr>
|
||||
nnoremap <leader>sv :Vexplore<cr>
|
||||
nnoremap <leader>sh :Hexplore<cr>
|
||||
|
||||
nmap <leader>h :map <leader><cr>
|
||||
|
||||
" nnoremap <leader>ad :ALEDetail<cr>
|
||||
" nnoremap <leader>ag :ALEGoToDefinition<cr>
|
||||
" nnoremap <leader>al :ALEPopulateQuickfix<cr>
|
||||
" nnoremap <leader>an :ALENext<cr>
|
||||
" nnoremap <leader>ap :ALEPrevious<cr>
|
||||
" nnoremap <leader>ar :ALERename<cr>
|
||||
|
||||
nnoremap <leader>b :BufExplorerHorizontalSplit<cr>
|
||||
|
||||
"}}}
|
||||
"
|
||||
lua require('init')
|
||||
|
||||
" folding options {{{
|
||||
" folding options, this must be last in file
|
||||
" vim:foldmethod=marker:foldlevel=0
|
||||
|
||||
" }}}
|
||||
11
slackware/home/nvim/.config/nvim/lua/config.lua
Normal file
11
slackware/home/nvim/.config/nvim/lua/config.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-- require('keybindings')
|
||||
-- require('package')
|
||||
-- require('config')
|
||||
|
||||
-- Global options: vim.o
|
||||
-- Local to window: vim.wo
|
||||
-- Local to buffer: vim.bo
|
||||
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.softtabstop = 2
|
||||
199
slackware/home/nvim/.config/nvim/lua/init.lua
Normal file
199
slackware/home/nvim/.config/nvim/lua/init.lua
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
require('keybindings')
|
||||
require('packages')
|
||||
require('config')
|
||||
|
||||
-- Treesitter Confirg
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = {
|
||||
"c", "lua", "rust", "python", "typescript", "bash", "clojure",
|
||||
"comment", "commonlisp", "fennel", "fish", "json", "html", "markdown",
|
||||
"make", "toml", "tsx", "vim", "yaml"
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
}
|
||||
}
|
||||
|
||||
-- LSP Language Installer
|
||||
local lsp_installer = require("nvim-lsp-installer")
|
||||
|
||||
-- Setup lspconfig.
|
||||
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', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
-- vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, 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', '<space>f', vim.lsp.buf.formatting, bufopts)
|
||||
end
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
lsp_installer.on_server_ready(function(server)
|
||||
local opts = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
if server.name == "sumneko_lua" then
|
||||
opts.settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = {'vim', 'use'}
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
server:setup(opts)
|
||||
end)
|
||||
|
||||
-- Needed for LuaSnip
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
-- LSP Completion
|
||||
local cmp = require('cmp')
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
completion = { autocomplete = false },
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
-- ['<C-a>'] = cmp.mapping.complete(), -- use supertab
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item(), {'i','c'}),
|
||||
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item(), {'i','c'}),
|
||||
["<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" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
},
|
||||
{
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
-- Set configuration for specific filetype.
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||
-- require('lspconfig').sumneko_lua.setup {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities,
|
||||
-- }
|
||||
|
||||
-- require('lspconfig')['tsserver'].setup {
|
||||
-- capabilities = capabilities
|
||||
-- }
|
||||
-- require('lspconfig')['tsserver'].setup {
|
||||
-- capabilities = capabilities
|
||||
-- }
|
||||
|
||||
|
||||
|
||||
-- TODO figure out fold stuff later
|
||||
-- vim.opt.foldmethod = "expr"
|
||||
-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
-- vim.opt.foldnestmax = 1
|
||||
vim.opt.completeopt = "menu" -- keep omnicomplete from spawning new buffer
|
||||
|
||||
-- Autoformatting
|
||||
require("formatter").setup {
|
||||
logging = false,
|
||||
log_level = vim.log.levels.WARN,
|
||||
filetype = {
|
||||
-- lua = {
|
||||
-- require("formatter.filetypes.lua").stylua,
|
||||
-- },
|
||||
python = {
|
||||
require("formatter.filetypes.python").black,
|
||||
},
|
||||
["*"] = {
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- You will likely want to reduce updatetime which affects CursorHold
|
||||
-- note: this setting is global and should be set only once
|
||||
vim.o.updatetime = 250
|
||||
vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
|
||||
|
||||
|
||||
-- Base16 colors
|
||||
|
||||
-- start flavours
|
||||
require('base16-colorscheme').setup({
|
||||
base00 = '#e7e6df',
|
||||
base01 = '#929181',
|
||||
base02 = '#878573',
|
||||
base03 = '#6c6b5a',
|
||||
base04 = '#5f5e4e',
|
||||
base05 = '#302f27',
|
||||
base06 = '#22221b',
|
||||
base07 = '#ba6236',
|
||||
base08 = '#ae7313',
|
||||
base09 = '#a5980d',
|
||||
base0A = '#7d9726',
|
||||
base0B = '#5b9d48',
|
||||
base0C = '#36a166',
|
||||
base0D = '#5f9182',
|
||||
base0E = '#9d6c7c',
|
||||
base0F = '#{{base0G-hex}}'
|
||||
})
|
||||
-- end flavours
|
||||
24
slackware/home/nvim/.config/nvim/lua/keybindings.lua
Normal file
24
slackware/home/nvim/.config/nvim/lua/keybindings.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
-- vim.api.nvim_set_keymap({mode}, {keymap}, {mapped to}, {options})
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true } -- don't recursively remap things
|
||||
|
||||
keymap('n', '?', ':tabNext<CR>', opts)
|
||||
-- keymap('n', 'gp', ':tabprevious<CR>', opts)
|
||||
|
||||
-- local function nkeymap(key, map)
|
||||
-- keymap('n', key, map, opts)
|
||||
-- end
|
||||
|
||||
-- nkeymap('gd', ':lua vim.lsp.buf.definition()<cr>')
|
||||
-- nkeymap('gD', ':lua vim.lsp.buf.declaration()<cr>')
|
||||
-- nkeymap('gi', ':lua vim.lsp.buf.implementation()<cr>')
|
||||
-- nkeymap('gw', ':lua vim.lsp.buf.document_symbol()<cr>')
|
||||
-- nkeymap('gw', ':lua vim.lsp.buf.workspace_symbol()<cr>')
|
||||
-- nkeymap('gr', ':lua vim.lsp.buf.references()<cr>')
|
||||
-- nkeymap('gt', ':lua vim.lsp.buf.type_definition()<cr>')
|
||||
-- nkeymap('K', ':lua vim.lsp.buf.hover()<cr>')
|
||||
-- nkeymap('<c-k>', ':lua vim.lsp.buf.signature_help()<cr>')
|
||||
-- nkeymap('<leader>af', ':lua vim.lsp.buf.code_action()<cr>')
|
||||
-- nkeymap('<leader>rn', ':lua vim.lsp.buf.rename()<cr>')
|
||||
|
||||
17
slackware/home/nvim/.config/nvim/lua/packages.lua
Normal file
17
slackware/home/nvim/.config/nvim/lua/packages.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
require('packer').startup(function()
|
||||
use 'wbthomason/packer.nvim'
|
||||
use 'nvim-treesitter/nvim-treesitter'
|
||||
use 'williamboman/nvim-lsp-installer'
|
||||
use 'neovim/nvim-lspconfig'
|
||||
use 'hrsh7th/cmp-nvim-lsp'
|
||||
use 'hrsh7th/cmp-buffer'
|
||||
use 'hrsh7th/cmp-path'
|
||||
use 'hrsh7th/cmp-cmdline'
|
||||
use 'hrsh7th/nvim-cmp'
|
||||
use 'L3MON4D3/LuaSnip'
|
||||
use 'rafamadriz/friendly-snippets'
|
||||
use 'saadparwaiz1/cmp_luasnip'
|
||||
use 'onsails/lspkind-nvim'
|
||||
use 'mhartington/formatter.nvim'
|
||||
use 'RRethy/nvim-base16'
|
||||
end)
|
||||
157
slackware/home/nvim/.config/nvim/plugin/packer_compiled.lua
Normal file
157
slackware/home/nvim/.config/nvim/plugin/packer_compiled.lua
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
-- Automatically generated packer.nvim plugin loader code
|
||||
|
||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||
end
|
||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||
local results = {}
|
||||
for i, elem in ipairs(sorted_times) do
|
||||
if not threshold or threshold and elem[2] > threshold then
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/home/green/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?.lua;/home/green/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?/init.lua;/home/green/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?.lua;/home/green/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/green/.cache/nvim/packer_hererocks/2.0.5/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], false)
|
||||
time([[try_loadstring definition]], true)
|
||||
local function try_loadstring(s, component, name)
|
||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||
if not success then
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||
end)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
LuaSnip = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
["cmp-buffer"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
||||
url = "https://github.com/hrsh7th/cmp-buffer"
|
||||
},
|
||||
["cmp-cmdline"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
|
||||
url = "https://github.com/hrsh7th/cmp-cmdline"
|
||||
},
|
||||
["cmp-nvim-lsp"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
["cmp-path"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/cmp-path",
|
||||
url = "https://github.com/hrsh7th/cmp-path"
|
||||
},
|
||||
cmp_luasnip = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
|
||||
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
["formatter.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/formatter.nvim",
|
||||
url = "https://github.com/mhartington/formatter.nvim"
|
||||
},
|
||||
["friendly-snippets"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/friendly-snippets",
|
||||
url = "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
["lspkind-nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/lspkind-nvim",
|
||||
url = "https://github.com/onsails/lspkind-nvim"
|
||||
},
|
||||
["nvim-base16"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/nvim-base16",
|
||||
url = "https://github.com/RRethy/nvim-base16"
|
||||
},
|
||||
["nvim-cmp"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
["nvim-lsp-installer"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer",
|
||||
url = "https://github.com/williamboman/nvim-lsp-installer"
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/green/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
if not no_errors then
|
||||
error_msg = error_msg:gsub('"', '\\"')
|
||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue