a bunch
This commit is contained in:
18
.eslintrc.json
Normal file
18
.eslintrc.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "standard-with-typescript",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"indent": ["error", 4],
|
||||
"semi": ["error", "always"],
|
||||
"quotes": ["error", "double"],
|
||||
"comma-dangle": ["error", "only-multiline"]
|
||||
}
|
||||
}
|
||||
6
.prettierrc.json
Normal file
6
.prettierrc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"trailingComma": "es5",
|
||||
"tabWidth": 4,
|
||||
"semi": true,
|
||||
"singleQuote": false
|
||||
}
|
||||
@@ -8,12 +8,15 @@ alias vl='vi ~/.config/nvim/init.lua'
|
||||
alias vv='vi ~/.config/nvim/vimrc.vim'
|
||||
alias gb='git branch'
|
||||
alias gl='git log'
|
||||
alias pp='vi ~/.profile'
|
||||
alias pg='git pull origin $(git branch --show-current)'
|
||||
alias gp='git push origin $(git branch --show-current)'
|
||||
alias gs='git status'
|
||||
alias gd='git diff'
|
||||
alias ga='git add --all'
|
||||
alias l='ls -l'
|
||||
alias i='ipython'
|
||||
alias python=python3
|
||||
alias v="vagrant ssh"
|
||||
alias tt='vi ~/.tmux.conf'
|
||||
alias t='tree -a -I "*.pyc|*__pycache__|.git|.data|.pytest_cache|.ruff_cache"'
|
||||
alias p3=python3
|
||||
alias l='ls -lrta'
|
||||
|
||||
203
init.lua
203
init.lua
@@ -23,39 +23,112 @@ vim.opt.signcolumn = "yes"
|
||||
vim.opt.isfname:append("@-@")
|
||||
|
||||
require("lazy").setup({
|
||||
"github/copilot.vim",
|
||||
"folke/tokyonight.nvim",
|
||||
"tpope/vim-commentary",
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.5',
|
||||
dependencies = { 'nvim-lua/plenary.nvim',
|
||||
'BurntSushi/ripgrep'}
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.5",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "BurntSushi/ripgrep" },
|
||||
},
|
||||
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'},
|
||||
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
|
||||
{'neovim/nvim-lspconfig'},
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{"mfussenegger/nvim-jdtls"},
|
||||
{'L3MON4D3/LuaSnip'},
|
||||
{"neoclide/coc.nvim", branch = 'release'},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||
},
|
||||
{ "VonHeikemen/lsp-zero.nvim", branch = "v3.x" },
|
||||
{ "neovim/nvim-lspconfig" },
|
||||
{ "nvim-treesitter/nvim-treesitter" },
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
svelte = { { "prettierd", "prettier" } },
|
||||
javascript = { { "prettierd", "prettier" } },
|
||||
typescript = { { "prettierd", "prettier" } },
|
||||
javascriptreact = { { "prettierd", "prettier" } },
|
||||
typescriptreact = { { "prettierd", "prettier" } },
|
||||
json = { { "prettierd", "prettier" } },
|
||||
graphql = { { "prettierd", "prettier" } },
|
||||
java = { "google-java-format" },
|
||||
kotlin = { "ktlint" },
|
||||
ruby = { "standardrb" },
|
||||
markdown = { { "prettierd", "prettier" } },
|
||||
erb = { "htmlbeautifier" },
|
||||
html = { "htmlbeautifier" },
|
||||
bash = { "beautysh" },
|
||||
proto = { "buf" },
|
||||
rust = { "rustfmt" },
|
||||
yaml = { "yamlfix" },
|
||||
toml = { "taplo" },
|
||||
css = { { "prettierd", "prettier" } },
|
||||
scss = { { "prettierd", "prettier" } },
|
||||
},
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile",
|
||||
},
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
svelte = { "eslint_d" },
|
||||
kotlin = { "ktlint" },
|
||||
terraform = { "tflint" },
|
||||
ruby = { "standardrb" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>ll", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
end,
|
||||
},
|
||||
{ "hrsh7th/nvim-cmp" },
|
||||
{ "hrsh7th/cmp-nvim-lsp" },
|
||||
{ "hrsh7th/cmp-buffer" },
|
||||
{ "hrsh7th/vim-vsnip" },
|
||||
{ "L3MON4D3/LuaSnip" },
|
||||
{ 'czheo/mojo.vim' },
|
||||
{ "neoclide/coc.nvim", branch = "release" },
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
})
|
||||
end
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
},
|
||||
})
|
||||
require('telescope').setup {
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
@@ -63,50 +136,62 @@ require('telescope').setup {
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
local vimrc = vim.fn.stdpath("config") .. "/vimrc.vim"
|
||||
vim.cmd.source(vimrc)
|
||||
local lsp_zero = require('lsp-zero')
|
||||
|
||||
lsp_zero.on_attach(function(client, bufnr)
|
||||
lsp_zero.default_keymaps({buffer = bufnr})
|
||||
end)
|
||||
require('lspconfig').pyright.setup({
|
||||
virtual_text=false,
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
mapping = {
|
||||
["C-y"] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
local config = {
|
||||
cmd = {
|
||||
--
|
||||
"/usr/bin/java", -- Or the absolute path '/path/to/java11_or_newer/bin/java'
|
||||
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
|
||||
"-Dosgi.bundles.defaultStartLevel=4",
|
||||
"-Declipse.product=org.eclipse.jdt.ls.core.product",
|
||||
"-Dlog.protocol=true",
|
||||
"-Dlog.level=ALL",
|
||||
"-Xms1g",
|
||||
"--add-modules=ALL-SYSTEM",
|
||||
"--add-opens",
|
||||
"java.base/java.util=ALL-UNNAMED",
|
||||
"--add-opens",
|
||||
"java.base/java.lang=ALL-UNNAMED",
|
||||
--
|
||||
"-jar",
|
||||
"/usr/local/Cellar/jdtls/1.32.0/libexec/plugins/org.eclipse.equinox.launcher_1.6.700.v20231214-2017.jar",
|
||||
"-configuration", "/usr/local/Cellar/jdtls/1.32.0/libexec/config_mac",
|
||||
"-data", "/Users/zev/.local/share/nvim/java"
|
||||
},
|
||||
settings = {
|
||||
java = {
|
||||
signatureHelp = {enabled = true},
|
||||
import = {enabled = true},
|
||||
rename = {enabled = true}
|
||||
}
|
||||
},
|
||||
init_options = {
|
||||
bundles = {}
|
||||
}
|
||||
}
|
||||
local lsp_zero = require("lsp-zero")
|
||||
|
||||
lsp_zero.on_attach(function(client, bufnr)
|
||||
lsp_zero.default_keymaps({ buffer = bufnr })
|
||||
end)
|
||||
require("lspconfig").pyright.setup({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require("lspconfig").clangd.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
vim.api.nvim_create_augroup("AutoFormat", {})
|
||||
|
||||
vim.api.nvim_create_autocmd(
|
||||
"BufWritePost",
|
||||
{
|
||||
pattern = "*.py",
|
||||
group = "AutoFormat",
|
||||
callback = function()
|
||||
vim.cmd("silent !black --line-length=120 --quiet %")
|
||||
vim.cmd("edit")
|
||||
end,
|
||||
})
|
||||
|
||||
local function on_list(options)
|
||||
vim.fn.setqflist({}, ' ', options)
|
||||
vim.api.nvim_command('cfirst')
|
||||
end
|
||||
|
||||
local bufopts = { noremap=true, silent=true, buffer=bufnr }
|
||||
vim.keymap.set('n', '<leader>d', function() vim.lsp.buf.definition{on_list=on_list} end, bufopts)
|
||||
vim.keymap.set('n', '<leader>r', function() vim.lsp.buf.references(nil, {on_list=on_list}) end, bufopts)
|
||||
|
||||
28
tmux.conf
28
tmux.conf
@@ -3,12 +3,32 @@ unbind C-b
|
||||
set-option -g prefix `
|
||||
bind-key ` send-prefix
|
||||
|
||||
# List of plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||
set -g @continuum-restore 'on'
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
run-shell ~/clone/path/resurrect.tmux
|
||||
set -g @continuum-save-interval '1'
|
||||
|
||||
|
||||
set -g mouse on
|
||||
set -g pane-border-style fg=black
|
||||
|
||||
set-option -sg escape-time 10
|
||||
set-option -g focus-events on
|
||||
set-option -g default-terminal "screen-256color"
|
||||
set-option -ga terminal-overrides ',xterm-256color:Tc'
|
||||
set-option -g history-limit 30000
|
||||
set-window-option -g aggressive-resize
|
||||
setw -g mode-keys vi
|
||||
bind-key -T copy-mode-vi y send -X copy-selection-and-cancel
|
||||
bind -T copy-mode-vi v send -X begin-selection
|
||||
bind P paste-buffer
|
||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
|
||||
|
||||
# bind ctrl-C to escape
|
||||
bind-key -n C-c send-keys Escape
|
||||
|
||||
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
# run-shell ~/clone/path/continuum.tmux
|
||||
|
||||
|
||||
41
vimrc.vim
41
vimrc.vim
@@ -1,5 +1,7 @@
|
||||
set autoindent expandtab tabstop=4 shiftwidth=4
|
||||
set hidden
|
||||
let g:python3_host_prog = '/usr/local/vitol/pyenv/versions/3.11.4/bin/python'
|
||||
|
||||
|
||||
" When editing a file, always jump to the last known cursor position.
|
||||
autocmd BufReadPost *
|
||||
@@ -8,7 +10,6 @@ autocmd BufReadPost *
|
||||
\ | endif
|
||||
|
||||
nnoremap <silent> <C-s> :w<cr>
|
||||
nnoremap <silent> <C-n> :noh<cr>
|
||||
nnoremap <C-l> :bn<cr>
|
||||
nnoremap <C-h> :bp<cr>
|
||||
inoremap <silent> <C-S> <esc>:w<cr>i
|
||||
@@ -16,30 +17,50 @@ let mapleader=" "
|
||||
nnoremap <leader>w :w<cr>:bw<cr>
|
||||
nnoremap <silent> <leader>W :bw<cr>
|
||||
nnoremap <leader>v :e ~/.config/nvim/init.lua<cr>
|
||||
nnoremap <leader>r :e ~/.config/nvim/vimrc.vim<cr>
|
||||
nnoremap <leader>t :e ~/.tmux.conf<cr>
|
||||
nnoremap <silent> <leader>x :Sex<cr>
|
||||
nnoremap <leader>m :e ~/.config/nvim/vimrc.vim<cr>
|
||||
nnoremap <leader>s :source ~/.config/nvim/init.lua<cr>
|
||||
nnoremap <leader>q :xa<cr>
|
||||
nnoremap <leader>f <cmd>Telescope find_files<cr>
|
||||
nnoremap <leader>g <cmd>Telescope live_grep<cr>
|
||||
nnoremap <leader>b <cmd>Telescope buffers<cr>
|
||||
nnoremap <leader>h <cmd>Telescope help_tags<cr>
|
||||
nnoremap <leader>l <cmd>Lazy<cr>
|
||||
nmap <silent> <leader>j <Plug>(coc-diagnostic-prev)
|
||||
nmap <silent> <leader>d <Plug>(coc-diagnostic-next)
|
||||
inoremap <expr><Tab> CheckBackspace() ? "\<Tab>" : "\<C-n>"
|
||||
function! s:c_cycle(count) abort
|
||||
let qf_info = getqflist({ 'idx': 0, 'size': 0 })
|
||||
let size = qf_info->get('size')
|
||||
if size == 0
|
||||
return
|
||||
endif
|
||||
|
||||
let idx = qf_info->get('idx')
|
||||
|
||||
let num = (idx + size + a:count) % size
|
||||
|
||||
if num == 0
|
||||
let num = size
|
||||
endif
|
||||
|
||||
execute num .. 'cc'
|
||||
endfunction
|
||||
command! -nargs=1 CCycle call s:c_cycle(<q-args>)
|
||||
|
||||
nnoremap <expr> [n '<Cmd>CCycle -' .. v:count1 .. '<CR>'
|
||||
nnoremap <expr> ]n '<Cmd>CCycle ' .. v:count1 .. '<CR>'
|
||||
|
||||
vnoremap <C-k> :m '<-2<CR>gv=gv
|
||||
vnoremap <C-j> :m '>+1<CR>gv=gv
|
||||
nnoremap <C-k> :m -2<CR>
|
||||
nnoremap <C-j> :m +1<CR>
|
||||
|
||||
function! CheckBackspace() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
augroup tokyonight-night
|
||||
autocmd!
|
||||
autocmd ColorScheme * highlight Normal guibg=NONE ctermbg=NONE
|
||||
autocmd ColorScheme * highlight NonText guibg=NONE ctermbg=NONE
|
||||
augroup END
|
||||
colorscheme tokyonight-night
|
||||
set background=dark
|
||||
|
||||
let g:LanguageClient_useVirtualText = 0 " disable inline errors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user