Compare commits
No commits in common. "80b3d066b3235def6d759c3cfc69e4f5d404be19" and "3a962d7cfb104887809efd05001a3e45df60f0f2" have entirely different histories.
80b3d066b3
...
3a962d7cfb
|
@ -1,4 +1,4 @@
|
||||||
#export BAT_THEME="Monokai Extended Light"
|
#export BAT_THEME="Solarized (light)"
|
||||||
export BAT_THEME="Solarized (light)"
|
export BAT_THEME="Monokai Extended Light"
|
||||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
||||||
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
# Use ~~ as the trigger sequence instead of the default **
|
|
||||||
export FZF_COMPLETION_TRIGGER='~~'
|
|
||||||
|
|
||||||
# Options to fzf command
|
|
||||||
export FZF_COMPLETION_OPTS='--border --info=inline'
|
|
||||||
export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix'
|
|
||||||
|
|
||||||
# Use fd (https://github.com/sharkdp/fd) instead of the default find
|
|
||||||
# command for listing path candidates.
|
|
||||||
# - The first argument to the function ($1) is the base path to start traversal
|
|
||||||
# - See the source code (completion.{bash,zsh}) for the details.
|
|
||||||
_fzf_compgen_path() {
|
|
||||||
fd --hidden --follow --exclude ".git" . "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Use fd to generate the list for directory completion
|
|
||||||
_fzf_compgen_dir() {
|
|
||||||
fd --type d --hidden --follow --exclude ".git" . "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# (EXPERIMENTAL) Advanced customization of fzf options via _fzf_comprun function
|
|
||||||
# - The first argument to the function is the name of the command.
|
|
||||||
# - You should make sure to pass the rest of the arguments to fzf.
|
|
||||||
_fzf_comprun() {
|
|
||||||
local command=$1
|
|
||||||
shift
|
|
||||||
|
|
||||||
case "$command" in
|
|
||||||
cd) fzf "$@" --preview 'tree -C {} | head -200' ;;
|
|
||||||
export|unset) fzf "$@" --preview "eval 'echo \$'{}" ;;
|
|
||||||
ssh) fzf "$@" --preview 'dig {}' ;;
|
|
||||||
*) fzf "$@" ;;
|
|
||||||
esac
|
|
||||||
}
|
|
|
@ -1,7 +1,12 @@
|
||||||
call plug#begin('~/.config/nvim/autoload/plugged')
|
call plug#begin('~/.config/nvim/autoload/plugged')
|
||||||
Plug 'junegunn/vim-easy-align'
|
Plug 'junegunn/vim-easy-align'
|
||||||
|
Plug 'tpope/vim-rails'
|
||||||
|
Plug 'vim-ruby/vim-ruby'
|
||||||
|
Plug 'hashivim/vim-terraform'
|
||||||
|
Plug 'cespare/vim-toml'
|
||||||
Plug 'ntpeters/vim-better-whitespace'
|
Plug 'ntpeters/vim-better-whitespace'
|
||||||
Plug 'itchyny/vim-gitbranch'
|
Plug 'itchyny/vim-gitbranch'
|
||||||
|
Plug 'rust-lang/rust.vim'
|
||||||
Plug 'airblade/vim-gitgutter'
|
Plug 'airblade/vim-gitgutter'
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
|
@ -10,10 +15,9 @@ Plug 'vim-airline/vim-airline-themes'
|
||||||
Plug 'kyazdani42/nvim-web-devicons'
|
Plug 'kyazdani42/nvim-web-devicons'
|
||||||
Plug 'kyazdani42/nvim-tree.lua'
|
Plug 'kyazdani42/nvim-tree.lua'
|
||||||
Plug 'svermeulen/vimpeccable'
|
Plug 'svermeulen/vimpeccable'
|
||||||
|
Plug 'sp5/nvim-colors-solarized'
|
||||||
Plug 'NoahTheDuke/vim-just'
|
Plug 'NoahTheDuke/vim-just'
|
||||||
Plug 'dewyze/vim-tada'
|
Plug 'dewyze/vim-tada'
|
||||||
Plug 'neovim/nvim-lspconfig'
|
|
||||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': 'TSUpdate'}
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
set nocompatible
|
set nocompatible
|
||||||
|
@ -66,6 +70,8 @@ filetype plugin indent on
|
||||||
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0
|
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0
|
||||||
autocmd FileType rust set shiftwidth=4 softtabstop=4 tabstop=4
|
autocmd FileType rust set shiftwidth=4 softtabstop=4 tabstop=4
|
||||||
autocmd FileType terraform set expandtab
|
autocmd FileType terraform set expandtab
|
||||||
|
let g:rustfmt_autosave = 1
|
||||||
|
let g:terraform_fmt_on_save = 1
|
||||||
autocmd FileType html set shiftwidth=4 softtabstop=4 tabstop=4
|
autocmd FileType html set shiftwidth=4 softtabstop=4 tabstop=4
|
||||||
autocmd FileType javascript set shiftwidth=4 softtabstop=4 tabstop=4
|
autocmd FileType javascript set shiftwidth=4 softtabstop=4 tabstop=4
|
||||||
autocmd FileType htmldjango set shiftwidth=4 softtabstop=4 tabstop=4
|
autocmd FileType htmldjango set shiftwidth=4 softtabstop=4 tabstop=4
|
||||||
|
@ -96,6 +102,13 @@ autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
|
||||||
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
|
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
|
||||||
autocmd BufWinLeave * call clearmatches()
|
autocmd BufWinLeave * call clearmatches()
|
||||||
|
|
||||||
|
let g:ale_linters = {
|
||||||
|
\ 'rust': ['analyzer'],
|
||||||
|
\ 'sh': ['shellcheck','shfmt','remove_trailing_lines','trim_whitespace'],
|
||||||
|
\ }
|
||||||
|
let g:ale_cursor_detail = 0
|
||||||
|
let g:ale_fix_on_save = 1
|
||||||
|
|
||||||
" Start interactive EasyAlign in visual mode (e.g. vipga)
|
" Start interactive EasyAlign in visual mode (e.g. vipga)
|
||||||
xmap ga <Plug>(EasyAlign)
|
xmap ga <Plug>(EasyAlign)
|
||||||
|
|
||||||
|
@ -135,8 +148,6 @@ noremap <F6> :call NumberToggle()<cr>
|
||||||
nnoremap <leader>e :NvimTreeToggle<CR>
|
nnoremap <leader>e :NvimTreeToggle<CR>
|
||||||
nnoremap <leader>r :NvimTreeRefresh<CR>
|
nnoremap <leader>r :NvimTreeRefresh<CR>
|
||||||
|
|
||||||
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.7 } }
|
|
||||||
|
|
||||||
lua << EOF
|
lua << EOF
|
||||||
require("nvim-tree").setup({
|
require("nvim-tree").setup({
|
||||||
sort_by = "case_sensitive",
|
sort_by = "case_sensitive",
|
||||||
|
@ -162,115 +173,3 @@ require("nvim-tree").setup({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
lua << EOF
|
|
||||||
require('nvim-treesitter.configs').setup {
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
disable = {},
|
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
enable = false,
|
|
||||||
disable = {},
|
|
||||||
},
|
|
||||||
ensure_installed = {
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"bash",
|
|
||||||
"vim",
|
|
||||||
"json",
|
|
||||||
"yaml",
|
|
||||||
"html",
|
|
||||||
"css",
|
|
||||||
"scss",
|
|
||||||
"lua",
|
|
||||||
"ruby",
|
|
||||||
"rust",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
|
|
||||||
-- parser_config.tsx.parser_to_fil = { "javascript", "typescript.tsx" }
|
|
||||||
EOF
|
|
||||||
|
|
||||||
lua << EOF
|
|
||||||
local nvim_lsp = require('lspconfig')
|
|
||||||
local protocol = require('vim.lsp.protocol')
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
-- Mappings
|
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
|
||||||
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<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('i', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>lwa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>lwr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>lwl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<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>d', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
|
||||||
--buf_set_keymap('n', '<C-j>', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>lgn', '<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)
|
|
||||||
buf_set_keymap('n', 'td', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
|
||||||
|
|
||||||
--if client.name == 'tsserver' then
|
|
||||||
-- client.resolved_capabilities.document_formatting = false
|
|
||||||
--end
|
|
||||||
|
|
||||||
if client.resolved_capabilities.document_formatting then
|
|
||||||
vim.api.nvim_command [[augroup Format]]
|
|
||||||
vim.api.nvim_command [[autocmd! * <buffer>]]
|
|
||||||
vim.api.nvim_command [[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()]]
|
|
||||||
vim.api.nvim_command [[augroup END]]
|
|
||||||
end
|
|
||||||
|
|
||||||
protocol.CompletionItemKind = {
|
|
||||||
'', -- Text
|
|
||||||
'', -- Method
|
|
||||||
'', -- Function
|
|
||||||
'', -- Constructor
|
|
||||||
'', -- Field
|
|
||||||
'', -- Variable
|
|
||||||
'', -- Class
|
|
||||||
'ﰮ', -- Interface
|
|
||||||
'', -- Module
|
|
||||||
'', -- Property
|
|
||||||
'', -- Unit
|
|
||||||
'', -- Value
|
|
||||||
'', -- Enum
|
|
||||||
'', -- Keyword
|
|
||||||
'', -- Snippet
|
|
||||||
'', -- Color
|
|
||||||
'', -- File
|
|
||||||
'', -- Reference
|
|
||||||
'', -- Folder
|
|
||||||
'', -- EnumMember
|
|
||||||
'', -- Constant
|
|
||||||
'', -- Struct
|
|
||||||
'', -- Event
|
|
||||||
'ﬦ', -- Operator
|
|
||||||
'', -- TypeParameter
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
nvim_lsp.tsserver.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
filetypes = { "typescript", "typescriptreact", "typescript.tsx" }
|
|
||||||
}
|
|
||||||
|
|
||||||
nvim_lsp.solargraph.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
flags = {
|
|
||||||
debounce_text_changes = 150,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
Loading…
Reference in New Issue