Compare commits

...

2 commits

Author SHA1 Message Date
d96cff8e1a misc 2024-03-24 22:41:00 +02:00
55403629fe nvim: retab, remaps 2024-03-24 22:40:25 +02:00
5 changed files with 102 additions and 75 deletions

View file

@ -1,16 +1,20 @@
require 'paq' {
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/nvim-cmp',
'neovim/nvim-lspconfig',
'nvim-lua/plenary.nvim',
'RRethy/nvim-base16',
'nvim-telescope/telescope.nvim',
'nvim-tree/nvim-tree.lua',
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' }
require "paq" {
"tiagovla/scope.nvim",
"RRethy/nvim-base16",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/nvim-cmp",
"lukas-reineke/indent-blankline.nvim",
"neovim/nvim-lspconfig",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }
}
require('colors')
require('sets')
require('maps')
require('plugins')
map = vim.keymap.set
tlp_builtin = require("telescope.builtin")
require("colors")
require("sets")
require("maps")
require("plugins")

View file

@ -1,35 +1,35 @@
vim.cmd('colorscheme base16-eighties')
local hl = vim.cmd.highlight
local base16 = require('base16-colorscheme')
base16.setup({
base00 = '#1a1a1a', base01 = '#262626', base02 = '#515151', base03 = '#747369',
base04 = '#a09f93', base05 = '#d3d0c8', base06 = '#e8e6df', base07 = '#f2f0ec',
base08 = '#f2f0ec', base09 = '#f99157', base0A = '#ffcc66', base0B = '#99cc99',
base0C = '#66cccc', base0D = '#538cc6', base0E = '#cc99cc', base0F = '#d27b53'
base00 = '#1a1a1a', base01 = '#262626', base02 = '#515151', base03 = '#747369',
base04 = '#a09f93', base05 = '#d3d0c8', base06 = '#e8e6df', base07 = '#f2f0ec',
base08 = '#f2f0ec', base09 = '#f99157', base0A = '#ffcc66', base0B = '#99cc99',
base0C = '#66cccc', base0D = '#538cc6', base0E = '#cc99cc', base0F = '#d27b53'
})
vim.cmd.highlight({'NormalFloat', 'guibg=' .. base16.colors.base01})
vim.cmd.highlight({'LineNr', 'guifg=' .. base16.colors.base03})
vim.cmd.highlight({'StatusLine', 'guibg=' .. base16.colors.base01})
vim.cmd.highlight({'TabLine', 'guifg=' .. base16.colors.base0D})
vim.cmd.highlight({'TabLineSel', 'guifg=' .. base16.colors.base0A})
hl({'NormalFloat', 'guibg=' .. base16.colors.base01})
hl({'LineNr', 'guifg=' .. base16.colors.base03})
hl({'StatusLine', 'guibg=' .. base16.colors.base01})
hl({'TabLine', 'guifg=' .. base16.colors.base0D})
hl({'TabLineSel', 'guifg=' .. base16.colors.base0A})
vim.cmd.highlight({'TelescopeNormal', 'guifg=' .. base16.colors.base0D, 'guibg=none'})
vim.cmd.highlight({'TelescopeBorder', 'guifg=' .. base16.colors.base02, 'guibg=none'})
vim.cmd.highlight({'TelescopePromptTitle', 'guifg=' .. base16.colors.base05, 'guibg=none'})
vim.cmd.highlight({'TelescopePreviewTitle', 'guifg=' .. base16.colors.base05, 'guibg=none'})
vim.cmd.highlight({'TelescopeResultsTitle', 'guifg=' .. base16.colors.base00, 'guibg=none'})
vim.cmd.highlight({'TelescopeSelection', 'guifg=' .. base16.colors.base0A, 'guibg=none', 'gui=bold'})
vim.cmd.highlight({'TelescopePromptNormal', 'guibg=' .. base16.colors.base01})
vim.cmd.highlight({'TelescopePreviewLine', 'guibg=' .. base16.colors.base02})
vim.cmd.highlight({'TelescopePromptBorder', 'guibg=none'})
hl({'TelescopeBorder', 'guifg=' .. base16.colors.base02, 'guibg=none'})
hl({'TelescopeMatching', 'guibg=' .. base16.colors.base09, 'guifg=' .. base16.colors.base01})
hl({'TelescopeNormal', 'guifg=' .. base16.colors.base0D, 'guibg=none'})
hl({'TelescopePreviewLine', 'guibg=' .. base16.colors.base02})
hl({'TelescopePreviewTitle', 'guifg=' .. base16.colors.base05, 'guibg=none'})
hl({'TelescopePromptBorder', 'guibg=none'})
hl({'TelescopePromptNormal', 'guibg=' .. base16.colors.base01})
hl({'TelescopePromptTitle', 'guifg=' .. base16.colors.base05, 'guibg=none'})
hl({'TelescopeResultsTitle', 'guifg=' .. base16.colors.base05, 'guibg=none'})
hl({'TelescopeSelection', 'guifg=' .. base16.colors.base0A, 'guibg=none', 'gui=bold'})
vim.cmd.highlight({'TSComment', 'gui=none'})
vim.cmd.highlight({'TSConstBuiltin', 'gui=none'})
vim.cmd.highlight({'TSFuncBuiltin', 'gui=none'})
vim.cmd.highlight({'TSEmphasis', 'gui=none'})
vim.cmd.highlight({'TSTypeBuiltin', 'gui=none'})
vim.cmd.highlight({'TSVariableBuiltin', 'gui=none'})
vim.cmd.highlight({'LspInlayHint', 'gui=none'})
vim.cmd.highlight({'TreesitterContext', 'gui=none'})
hl({'LspInlayHint', 'gui=none'})
hl({'TSConstBuiltin', 'gui=none'})
hl({'TSFuncBuiltin', 'gui=none'})
hl({'TSTypeBuiltin', 'gui=none'})
hl({'TSVariableBuiltin', 'gui=none'})
hl({'TreesitterContext', 'gui=none'})

View file

@ -1,27 +1,38 @@
local map = vim.keymap.set
local builtin = require('telescope.builtin')
vim.g.mapleader = " "
vim.g.mapleader = ' '
map("n", "<C-h>", "<C-w>W")
map("n", "<C-l>", "<C-w>w")
map("n", '<C-t>', '<C-w>r')
map("n", '<C-s>', '<C-w>T')
map("v", '.', ':normal .<CR>')
map('n', '<C-h>', '<C-w>h')
map('n', '<C-j>', '<C-w>j')
map('n', '<C-k>', '<C-w>k')
map('n', '<C-l>', '<C-w>l')
map('n', '<C-t>', '<C-w>r')
map('n', '<C-s>', '<C-w>T')
map('v', '.', ':normal .<CR>')
map("n", "<C-j>", ":tabn<CR>")
map("n", "<C-k>", ":tabp<CR>")
map("n", "g0", ":tabfir<CR>")
map("n", "gJ", ":+tabm<CR>")
map("n", "gK", ":-tabm<CR>")
map('n', 'K', ':tabprevious<CR>')
map('n', 'J', ':tabnext<CR>')
map("v", "J", ":m '>+1<CR>gv=gv")
map("v", "K", ":m '<-2<CR>gv=gv")
map('n', '<C-o>', ':bprevious<CR>')
map('n', '<C-p>', ':bnext<CR>')
map('n', '<C-x>', ':bdelete<CR>')
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
map('n', '<leader>d', ':NvimTreeFindFileToggle<CR>')
map('n', '<leader>f', builtin.find_files, {})
map('n', '<leader>b', builtin.buffers, {})
map('n', '<leader>g', builtin.live_grep, {})
map('', '<leader>c', ':w! | !compiler "<c-r>%"<CR>')
map('', '<leader>p', ':!opout <c-r>%<CR><CR>')
map('', '<leader>se', ':setlocal spell! spelllang=en_us<CR>')
map("n", "n", "nzzzv")
map("n", "N", "Nzzzv")
map("n", "<leader>d", "\"_d")
map("x", "<leader>d", "\"_d")
map("x", "<leader>p", "\"_dP")
map("n", "<C-o>", ":bprevious<cr>")
map("n", "<C-p>", ":bnext<cr>")
map("n", "<C-x>", ":bdelete<CR>")
map("n", "<leader>b", tlp_builtin.buffers)
map("n", "<leader>f", tlp_builtin.find_files)
map("n", "<leader>g", tlp_builtin.live_grep)
map("n", "<leader>c", ":w! | !compiler '<c-r>%'<CR>")
map("n", "<leader>s", ":Explore<CR>")
map("n", "<leader>op", ":!opout <c-r>%<CR><CR>")
map("n", "<leader>se", ":setlocal spell! spelllang=en_us<CR>")

View file

@ -1,30 +1,42 @@
o = vim.o
au = vim.api.nvim_create_autocmd
wo = vim.wo
local o = vim.o
local au = vim.api.nvim_create_autocmd
local wo = vim.wo
o.clipboard = "unnamedplus"
o.completeopt = "menu,menuone,noselect"
o.clipboard = 'unnamedplus'
o.completeopt = 'menu', 'menuone', 'noselect'
o.hlsearch = false
o.incsearch = true
o.ignorecase = true
o.laststatus = 3
o.list = true
o.listchars = 'nbsp:¬,tab:»·,trail:·,extends:>'
o.mouse = 'a'
o.nu = true
o.listchars="nbsp:¬,tab:┆ ,trail:·,extends:>"
o.mouse = "a"
o.number = true
o.relativenumber = true
o.scrolloff = 8
o.tabstop = 4
o.softtabstop = 4
o.shiftwidth = 4
o.smartindent = true
o.showcmd = true
o.showmode = true
o.showtabline = 2
o.laststatus = 3
o.smartcase = true
o.splitright = true
o.swapfile = false
o.undofile = true
o.termguicolors = true
o.undofile = true
wo.wrap = false
au({ 'BufWritePre' }, { pattern = { '*' }, command = [[%s/\n\+\%$//e]] })
au('FileType', { pattern = 'dart', command = 'setlocal ts=2 sw=2 et' })
au("BufWritePre", { pattern = "*", command = [[%s/\n\+\%$//e]] })
au("FileType", { pattern = "help", command = ":wincmd L | :vert" })
au("FileType", { pattern = "lua", command = "setlocal ts=3 sw=3 et" })

View file

@ -22,7 +22,7 @@ case "$ext" in
[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;;
c) cc "$file" -o "$base" && "$base" ;;
cpp) g++ "$file" -o "$base" && "$base" ;;
cs) mcs "$file" && mono "$base".exe ;;
cs) dotnet run "$file" ;;
dart) dart run "$file" ;;
go) go run "$file" ;;
h) doas make install ;;