Compare commits

..

10 Commits

Author SHA1 Message Date
Patryk Koreń
a109dc1f55 Update init.lua 2025-04-25 12:16:55 +02:00
Patryk Koreń
6c236d0d82 Update .clang-format 2025-04-04 23:51:34 +02:00
Patryk Koreń
c236b872e3 Create .clang-format 2025-04-04 20:54:47 +02:00
Patryk Koreń
280b3410ad Fixed neovim package name 2024-06-08 01:51:49 +02:00
Patryk Koreń
31ba892afa Update ubuntu.sh 2024-05-09 19:06:29 +02:00
Patryk Koreń
421467a8bd Create ubuntu.sh 2024-05-09 18:26:34 +02:00
Patryk Koreń
3c64f0e4b1 Cange C-a back to C-b 2024-04-18 10:44:19 +02:00
Patryk Koreń
c31f64b2cd create tmux.conf 2024-04-18 10:28:22 +02:00
Patryk Koreń
e6716db162 Update init.lua 2024-04-09 23:00:50 +02:00
Patryk Koreń
c97782eab3 Update init.lua
added path and buffer suggestions
2024-04-09 20:34:50 +02:00
4 changed files with 163 additions and 38 deletions

3
.clang-format Normal file
View File

@@ -0,0 +1,3 @@
IndentWidth: 4
TabWidth: 4
PointerAlignment: Left

View File

@@ -4,7 +4,7 @@ vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.hlsearch = false vim.opt.hlsearch = false
vim.opt.incsearch = true vim.opt.incsearch = true
vim.opt.colorcolumn = "80" vim.opt.colorcolumn = "80,120"
vim.opt.tabstop = 4 vim.opt.tabstop = 4
vim.opt.softtabstop = 4 vim.opt.softtabstop = 4
@@ -14,6 +14,18 @@ vim.opt.expandtab = true
vim.opt.smartindent = true vim.opt.smartindent = true
vim.opt.scrolloff = 8 vim.opt.scrolloff = 8
-- :map [[ ?{<CR>w99[{
-- :map ][ /}<CR>b99]}
-- :map ]] j0[[%/{<CR>
-- :map [] k$][%?}<CR>
-- rewrite in lua
-- vim.keymap.set({ "n" }, "[[", function() vim.cmd("normal ?{\<CR>w99[{") end, { silent = true })
-- vim.keymap.set({ "n" }, "][", function() vim.cmd("normal /}\<CR>b99]}") end, { silent = true })
-- vim.keymap.set({ "n" }, "]]", function() vim.cmd("normal j0[[%/{\<CR>") end, { silent = true })
-- vim.keymap.set({ "n" }, "[]", function() vim.cmd("normal k$][%?}\<CR>") end, { silent = true })
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
@@ -28,22 +40,47 @@ end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
{ "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...}, {
{'mg979/vim-visual-multi'}, "ellisonleao/gruvbox.nvim",
{'williamboman/mason.nvim'}, priority = 1000,
{'williamboman/mason-lspconfig.nvim'}, config = true,
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'}, opts = ...
{'neovim/nvim-lspconfig'}, },
{'hrsh7th/cmp-nvim-lsp'}, { 'mg979/vim-visual-multi' },
{'hrsh7th/nvim-cmp'}, { 'tpope/vim-fugitive' },
{'L3MON4D3/LuaSnip'}, { 'williamboman/mason.nvim' },
{'nvim-treesitter/nvim-treesitter'}, { 'williamboman/mason-lspconfig.nvim' },
{'mbbill/undotree'}, {
{'nvim-telescope/telescope.nvim', branch = '0.1.x', 'VonHeikemen/lsp-zero.nvim',
dependencies = { 'nvim-lua/plenary.nvim' }}, branch = 'v3.x'
},
{ 'neovim/nvim-lspconfig' },
{ 'github/copilot.vim' },
{ 'hrsh7th/cmp-nvim-lsp' },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/cmp-path' },
{ 'hrsh7th/cmp-cmdline' },
{ 'hrsh7th/nvim-cmp' },
{ 'saadparwaiz1/cmp_luasnip' },
{
'L3MON4D3/LuaSnip',
version = "v2.*",
dependencies = { "rafamadriz/friendly-snippets" },
},
{ 'nvim-treesitter/nvim-treesitter' },
{ 'mbbill/undotree' },
{
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{ {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, cmd = {
"MarkdownPreviewToggle",
"MarkdownPreview",
"MarkdownPreviewStop"
},
ft = { "markdown" }, ft = { "markdown" },
build = function() vim.fn["mkdp#util#install"]() end, build = function() vim.fn["mkdp#util#install"]() end,
}, },
@@ -55,21 +92,24 @@ vim.cmd([[colorscheme gruvbox]])
local lsp_zero = require('lsp-zero') local lsp_zero = require('lsp-zero')
lsp_zero.preset('recommended') lsp_zero.preset('recommended')
lsp_zero.on_attach(function(client, bufnr) lsp_zero.on_attach(function(client, bufnr)
lsp_zero.default_keymaps({buffer = bufnr}) lsp_zero.default_keymaps({ buffer = bufnr })
end) end)
lsp_zero.setup() lsp_zero.setup()
require('mason').setup({}) require('mason').setup({})
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
ensure_installed = {}, ensure_installed = { 'lua_ls', 'rust_analyzer', 'clangd', 'biome', 'cmake',
'dockerls', 'html', 'grammarly', 'zls' },
handlers = { handlers = {
lsp_zero.default_setup, lsp_zero.default_setup,
}, },
}) })
require'nvim-treesitter.configs'.setup { require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" -- A list of parser names, or "all"
ensure_installed = { "javascript", "typescript", "c", "lua", "rust", "python", ensure_installed = { "javascript", "typescript", "c", "lua", "rust",
"gdscript", "html", "css", "sql", "markdown" }, "python", "gdscript", "html", "css", "sql", "markdown", "org" },
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
@@ -90,7 +130,21 @@ require'nvim-treesitter.configs'.setup {
}, },
} }
local builtin = require('telescope.builtin') local builtin = require('telescope.builtin')
--- TODO: What is expand?
vim.keymap.set({ "i" }, "<C-s>e", function() ls.expand() end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-s>;", function() ls.jump(1) end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-s>,", function() ls.jump(-1) end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-E>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end, { silent = true })
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>fb', builtin.buffers, {}) vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
@@ -99,5 +153,40 @@ vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex) vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle) vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
local ls = require("luasnip")
ls.filetype_extend("javascript", { "jsdoc" })
local cmp = require('cmp')
local cmp_format = lsp_zero.cmp_format({ details = true })
cmp.setup({
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' },
},
--- (Optional) Show source name in completion menu
formatting = cmp_format,
})
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{
name = 'cmdline',
option = {
ignore_cmds = { 'Man', '!' }
}
}
})
})
require("luasnip.loaders.from_vscode").lazy_load()
-- markdown -- markdown
vim.g.mkdp_auto_start = 1 vim.g.mkdp_auto_start = 1

17
.config/tmux/tmux.conf Normal file
View File

@@ -0,0 +1,17 @@
set -ga terminal-overrides ",screen-256color*:Tc"
set-option -g default-terminal "screen-256color"
set -s escape-time 0
set -g status-style 'bg=#98971a fg=#1d2021'
set -g mouse on
set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# vim-like pane switching
bind -r ^ last-window
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R

16
ubuntu.sh Normal file
View File

@@ -0,0 +1,16 @@
sudo apt update
sudo add-apt-repository ppa:neovim-ppa/unstable
sudo apt install build-essential btop fish neovim tmux curl git nodejs npm ripgrep
curl -fsSL https://bun.sh/install | bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl -L https://foundry.paradigm.xyz | bash
source /home/patryk/.bashrc
foundryup
sudo apt install chromium alacritty vlc krita inkscape blender
which fish
chsh patryk