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.lazy")
|
||||
require("bumpsoo.set")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
"tpope/vim-fugitive",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||
end
|
||||
"tpope/vim-fugitive",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,93 +1,78 @@
|
|||
local config = function()
|
||||
-- Add additional capabilities supported by nvim-cmp
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local lspconfig = require('lspconfig')
|
||||
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', '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.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.rename()<CR>', opts)
|
||||
-- buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
||||
-- 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
|
||||
-- Add additional capabilities supported by nvim-cmp
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local lspconfig = require('lspconfig')
|
||||
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', '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.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.rename()<CR>', opts)
|
||||
end
|
||||
|
||||
-- Enable some language servers with the additional
|
||||
-- completion capabilities offered by nvim-cmp
|
||||
local servers = { 'gopls', 'erlangls' }
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
local luasnip = require 'luasnip'
|
||||
|
||||
local cmp = require 'cmp'
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
|
||||
-- C-b (back) C-f (forward) for snippet placeholder navigation.
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
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 = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
}
|
||||
-- Enable some language servers with the additional
|
||||
-- completion capabilities offered by nvim-cmp
|
||||
local servers = { 'gopls', 'erlangls' }
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
local luasnip = require 'luasnip'
|
||||
local cmp = require 'cmp'
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
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 = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
'hrsh7th/nvim-cmp',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'L3MON4D3/LuaSnip',
|
||||
},
|
||||
config = config
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
'hrsh7th/nvim-cmp',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'L3MON4D3/LuaSnip',
|
||||
},
|
||||
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 {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.4',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>ft', builtin.help_tags, {})
|
||||
end
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.4',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>ft', builtin.help_tags, {})
|
||||
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 {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local cfg = require("nvim-treesitter.configs")
|
||||
cfg.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
"json",
|
||||
"erlang",
|
||||
"lua",
|
||||
},
|
||||
})
|
||||
end
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local cfg = require("nvim-treesitter.configs")
|
||||
cfg.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
"json",
|
||||
"erlang",
|
||||
"lua",
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,14 @@ vim.opt.colorcolumn = "80"
|
|||
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = {
|
||||
tab = "→ ",
|
||||
space = "·",
|
||||
nbsp = "+",
|
||||
tab = "→ ",
|
||||
space = "·",
|
||||
nbsp = "+",
|
||||
}
|
||||
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.expandtab = true
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,6 @@
|
|||
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
|
||||
|
||||
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
|
||||
### dev configuration for linux
|
||||
|
||||
- neovim (.config/nvim/\*)
|
||||
- git (.gitconfig ~/personal/.gitconfig)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue