wsl -> linux
This commit is contained in:
parent
2941112f9d
commit
0a17c0ca16
10 changed files with 121 additions and 156 deletions
|
|
@ -1,13 +1,3 @@
|
||||||
vim.opt.clipboard = "unnamedplus"
|
|
||||||
if vim.fn.has('wsl') == 1 then
|
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
|
||||||
group = vim.api.nvim_create_augroup('Yank', { clear = true }),
|
|
||||||
callback = function()
|
|
||||||
vim.fn.system('clip.exe', vim.fn.getreg('"'))
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
require("bumpsoo.remap")
|
require("bumpsoo.remap")
|
||||||
require("bumpsoo.lazy")
|
require("bumpsoo.lazy")
|
||||||
require("bumpsoo.set")
|
require("bumpsoo.set")
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
return {
|
return {
|
||||||
"tpope/vim-fugitive",
|
"tpope/vim-fugitive",
|
||||||
config = function()
|
config = function()
|
||||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,93 +1,78 @@
|
||||||
local config = function()
|
local config = function()
|
||||||
-- Add additional capabilities supported by nvim-cmp
|
-- Add additional capabilities supported by nvim-cmp
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
local lspconfig = require('lspconfig')
|
local lspconfig = require('lspconfig')
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
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
|
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||||
-- Mappings.
|
-- Mappings.
|
||||||
local opts = { noremap=true, silent=true }
|
local opts = { noremap=true, silent=true }
|
||||||
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||||
buf_set_keymap('n', 'gD', '<cmd>tab split | lua vim.lsp.buf.declaration()<CR>', opts)
|
buf_set_keymap('n', 'gD', '<cmd>tab split | lua vim.lsp.buf.declaration()<CR>', opts)
|
||||||
buf_set_keymap('n', 'gd', '<cmd>tab split | lua vim.lsp.buf.definition()<CR>', opts)
|
buf_set_keymap('n', 'gd', '<cmd>tab split | lua vim.lsp.buf.definition()<CR>', opts)
|
||||||
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||||
buf_set_keymap('n', 'gR', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
buf_set_keymap('n', 'gR', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
end
|
||||||
-- buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<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>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
|
||||||
-- buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
|
||||||
-- buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Enable some language servers with the additional
|
-- Enable some language servers with the additional
|
||||||
-- completion capabilities offered by nvim-cmp
|
-- completion capabilities offered by nvim-cmp
|
||||||
local servers = { 'gopls', 'erlangls' }
|
local servers = { 'gopls', 'erlangls' }
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
lspconfig[lsp].setup {
|
lspconfig[lsp].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
local luasnip = require 'luasnip'
|
||||||
local luasnip = require 'luasnip'
|
local cmp = require 'cmp'
|
||||||
|
cmp.setup {
|
||||||
local cmp = require 'cmp'
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
cmp.setup {
|
luasnip.lsp_expand(args.body)
|
||||||
snippet = {
|
end,
|
||||||
expand = function(args)
|
},
|
||||||
luasnip.lsp_expand(args.body)
|
mapping = cmp.mapping.preset.insert({
|
||||||
end,
|
['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
|
||||||
},
|
['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
|
||||||
mapping = cmp.mapping.preset.insert({
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
|
['<CR>'] = cmp.mapping.confirm {
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
-- C-b (back) C-f (forward) for snippet placeholder navigation.
|
select = true,
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
},
|
||||||
['<CR>'] = cmp.mapping.confirm {
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
if cmp.visible() then
|
||||||
select = true,
|
cmp.select_next_item()
|
||||||
},
|
elseif luasnip.expand_or_jumpable() then
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
luasnip.expand_or_jump()
|
||||||
if cmp.visible() then
|
else
|
||||||
cmp.select_next_item()
|
fallback()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
end
|
||||||
luasnip.expand_or_jump()
|
end, { 'i', 's' }),
|
||||||
else
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
fallback()
|
if cmp.visible() then
|
||||||
end
|
cmp.select_prev_item()
|
||||||
end, { 'i', 's' }),
|
elseif luasnip.jumpable(-1) then
|
||||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
luasnip.jump(-1)
|
||||||
if cmp.visible() then
|
else
|
||||||
cmp.select_prev_item()
|
fallback()
|
||||||
elseif luasnip.jumpable(-1) then
|
end
|
||||||
luasnip.jump(-1)
|
end, { 'i', 's' }),
|
||||||
else
|
}),
|
||||||
fallback()
|
sources = {
|
||||||
end
|
{ name = 'nvim_lsp' },
|
||||||
end, { 'i', 's' }),
|
{ name = 'luasnip' },
|
||||||
}),
|
},
|
||||||
sources = {
|
}
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'hrsh7th/nvim-cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
'saadparwaiz1/cmp_luasnip',
|
'saadparwaiz1/cmp_luasnip',
|
||||||
'L3MON4D3/LuaSnip',
|
'L3MON4D3/LuaSnip',
|
||||||
},
|
},
|
||||||
config = config
|
config = config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
10
.config/nvim/lua/bumpsoo/plugins/solarized.lua
Normal file
10
.config/nvim/lua/bumpsoo/plugins/solarized.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
return {
|
||||||
|
'maxmx03/solarized.nvim',
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
vim.o.background = 'light'
|
||||||
|
|
||||||
|
vim.cmd.colorscheme 'solarized'
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
return {
|
return {
|
||||||
'nvim-telescope/telescope.nvim', tag = '0.1.4',
|
'nvim-telescope/telescope.nvim', tag = '0.1.4',
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
config = function()
|
config = function()
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||||
vim.keymap.set('n', '<leader>ft', builtin.help_tags, {})
|
vim.keymap.set('n', '<leader>ft', builtin.help_tags, {})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
return {
|
|
||||||
"folke/tokyonight.nvim",
|
|
||||||
lazy = false,
|
|
||||||
priority = 1000,
|
|
||||||
opts = {},
|
|
||||||
config = function()
|
|
||||||
vim.cmd[[colorscheme tokyonight-day]]
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +1,20 @@
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
local cfg = require("nvim-treesitter.configs")
|
local cfg = require("nvim-treesitter.configs")
|
||||||
cfg.setup({
|
cfg.setup({
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
indent = {
|
indent = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"json",
|
"json",
|
||||||
"erlang",
|
"erlang",
|
||||||
"lua",
|
"lua",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,14 @@ vim.opt.colorcolumn = "80"
|
||||||
|
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
vim.opt.listchars = {
|
vim.opt.listchars = {
|
||||||
tab = "→ ",
|
tab = "→ ",
|
||||||
space = "·",
|
space = "·",
|
||||||
nbsp = "+",
|
nbsp = "+",
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.opt.tabstop = 2
|
vim.opt.tabstop = 2
|
||||||
vim.opt.softtabstop = 2
|
vim.opt.softtabstop = 2
|
||||||
vim.opt.shiftwidth = 2
|
vim.opt.shiftwidth = 2
|
||||||
vim.opt.smartindent = true
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1,6 @@
|
||||||
setw -g mode-keys vi
|
setw -g mode-keys vi
|
||||||
|
|
||||||
|
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||||
|
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
||||||
|
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
|
||||||
|
|
||||||
|
|
|
||||||
18
README.md
18
README.md
|
|
@ -1,20 +1,4 @@
|
||||||
### from wsl - alpine
|
### dev configuration for linux
|
||||||
|
|
||||||
running [mini root fs](https://www.alpinelinux.org/downloads/)
|
|
||||||
|
|
||||||
```
|
|
||||||
wsl --import Alpine 'E:\alpine\' E:\alpine-minirootfs-3.18.4-x86_64.tar
|
|
||||||
```
|
|
||||||
|
|
||||||
dependencies
|
|
||||||
|
|
||||||
```
|
|
||||||
apk add neovim tmux git openssh ripgrep curl gcc go
|
|
||||||
|
|
||||||
go install golang.org/x/tools/gopls@latest
|
|
||||||
```
|
|
||||||
|
|
||||||
### dev configuration for alpine linux
|
|
||||||
|
|
||||||
- neovim (.config/nvim/\*)
|
- neovim (.config/nvim/\*)
|
||||||
- git (.gitconfig ~/personal/.gitconfig)
|
- git (.gitconfig ~/personal/.gitconfig)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue