summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhc <hc@email.ch>2024-09-26 02:08:43 +0800
committerhc <hc@email.ch>2024-09-26 02:08:43 +0800
commit5639ff2ae3fb7a7796ca78646f86f8346f120c2b (patch)
treeae37ec62352e72ffa303a211398fa7eff63765ba
parenta2f703ec02bc1589a540b67b9c82683043c622b2 (diff)
change all to vanilla vim, mroe stable
-rwxr-xr-xsetup.sh76
1 files changed, 10 insertions, 66 deletions
diff --git a/setup.sh b/setup.sh
index 5e103be..5661b0f 100755
--- a/setup.sh
+++ b/setup.sh
@@ -12,81 +12,25 @@ sudo dnf install -y nc autossh tmux htop tar bmon gzip tree wget curl mlocate na
12#pip install jupyterlab python-swiftclient 12#pip install jupyterlab python-swiftclient
13sudo dnf update -y 13sudo dnf update -y
14 14
15#install nvim 15cat << EOF > /etc/vimrc
16sudo dnf groupinstall -y "Development Tools"
17sudo dnf install -y cmake
18cd ~
19git clone https://github.com/neovim/neovim
20cd neovim
21make CMAKE_BUILD_TYPE=RelWithDebInfo
22sudo make install
23cd ~
24
25#install lunarvim
26sudo dnf install -y git make python3 python3-pip nodejs gcc-c++
27curl https://sh.rustup.rs -sSf | sh -s -- -y
28source "$HOME/.cargo/env"
29sudo dnf group install -y "Development Tools"
30yes | bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh)
31cat << EOF > ~/.config/lvim/config.lua
32lvim.plugins = {
33 {
34 "folke/tokyonight.nvim",
35 lazy = false,
36 priority = 1000,
37 opts = {},
38 }
39}
40
41vim.cmd([[
42augroup netcat_clipboard 16augroup netcat_clipboard
43 au! 17 au!
44 au TextYankPost * call system("openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.0nom.ch 5023", @") 18 au TextYankPost * call system("openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.0nom.ch 5023", @")
45
46augroup END 19augroup END
47]])
48
49-- Enable line wrapping
50vim.wo.wrap = true
51 20
52-- Optional: Make wrapped lines easier to read by indenting them 21" Enable line wrapping
53vim.wo.breakindent = true 22set wrap
54vim.wo.breakindentopt = "shift:2"
55 23
56-- Navigate to the next tab, shift-l, prev shift-h 24" Optional: Make wrapped lines easier to read by indenting them
57vim.api.nvim_set_keymap('n', '<S-l>', ':BufferLineCycleNext<CR>', { noremap = true, silent = true }) 25set breakindent
58vim.api.nvim_set_keymap('n', '<S-h>', ':BufferLineCyclePrev<CR>', { noremap = true, silent = true }) 26set breakindentopt=shift:2
59 27
60vim.api.nvim_create_autocmd("BufWritePost", { 28set list
61 pattern = "*.cpp", 29set listchars=tab:>-
62 command = "!g++ % -o %< && chmod +x %<" 30set autoindent
63}) 31set number
64EOF 32EOF
65 33
66-- Fix for vim.tbl_add_reverse_lookup deprecation
67-- Replace any usage of vim.tbl_add_reverse_lookup with:
68local function add_reverse_lookup(tbl)
69 local result = {}
70 for k, v in pairs(tbl) do
71 result[k] = v
72 result[v] = k
73 end
74 return result
75end
76
77-- Fix for vim.treesitter.get_parser warning
78-- Wrap any usage of vim.treesitter.get_parser with a pcall:
79local function safe_get_parser(bufnr, lang)
80 local ok, parser = pcall(vim.treesitter.get_parser, bufnr, lang)
81 if ok then
82 return parser
83 else
84 -- Handle the error or return nil
85 return nil
86 end
87end
88
89
90# add check fro each component 34# add check fro each component
91 35
92# then git clone work directory, or git clone altogether 36# then git clone work directory, or git clone altogether