aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2022-10-26 13:59:06 +0200
committeromagdy7 <omar.professional8777@gmail.com>2022-10-26 13:59:06 +0200
commitbacd7665cfcef1321b13fbbe14e3e20bb0b54bd0 (patch)
treefee46dabbe2056d009d1fbf6baa4d17692365456
parentb62e938bf36f8a567c7cf4ee2e94daeb1336056b (diff)
downloaddotfiles-bacd7665cfcef1321b13fbbe14e3e20bb0b54bd0.tar.xz
dotfiles-bacd7665cfcef1321b13fbbe14e3e20bb0b54bd0.zip
Changed somestuff in nvim config
-rw-r--r--kitty/.config/kitty/current-theme.conf82
-rw-r--r--kitty/.config/kitty/kitty.conf2
-rw-r--r--kitty/.config/kitty/kitty.conf.bak5
-rw-r--r--nvim/.config/nvim/init.lua21
-rw-r--r--nvim/.config/nvim/lua/user/keymaps.lua28
-rw-r--r--nvim/.config/nvim/lua/user/lsp/handlers.lua2
-rw-r--r--nvim/.config/nvim/lua/user/luasnip.lua43
-rw-r--r--nvim/.config/nvim/lua/user/options.lua2
-rw-r--r--nvim/.config/nvim/lua/user/plugins.lua1
-rw-r--r--nvim/.config/nvim/lua/user/snippets.lua13
10 files changed, 161 insertions, 38 deletions
diff --git a/kitty/.config/kitty/current-theme.conf b/kitty/.config/kitty/current-theme.conf
index 2543819..27e21a0 100644
--- a/kitty/.config/kitty/current-theme.conf
+++ b/kitty/.config/kitty/current-theme.conf
@@ -1,21 +1,61 @@
-background #090200
-foreground #a4a1a1
-cursor #a4a1a1
-selection_background #494542
-color0 #090200
-color8 #5b5754
-color1 #da2c20
-color9 #e8bacf
-color2 #00a152
-color10 #3a3332
-color3 #fcec02
-color11 #494542
-color4 #00a0e4
-color12 #7f7c7b
-color5 #a06994
-color13 #d6d4d3
-color6 #b5e4f4
-color14 #ccab53
-color7 #a4a1a1
-color15 #f7f7f7
-selection_foreground #090200
+# vim:ft=kitty
+
+## name: GitHub Dark
+## author: GitHub
+## license: MIT
+
+#: The basic colors
+
+foreground #c9d1d9
+background #0d1117
+selection_foreground #0d1117
+selection_background #58a6ff
+
+
+#: Cursor colors
+
+cursor #58a6ff
+
+
+#: Tab bar colors
+
+tab_bar_background #010409
+active_tab_foreground #c9d1d9
+active_tab_background #0d1117
+inactive_tab_foreground #8b949e
+inactive_tab_background #010409
+
+
+#: The basic 16 colors
+
+#: black
+color0 #484f58
+color8 #6e7681
+
+#: red
+color1 #ff7b72
+color9 #ffa198
+
+#: green
+color2 #3fb950
+color10 #56d364
+
+#: yellow
+color3 #d29922
+color11 #e3b341
+
+#: blue
+color4 #58a6ff
+color12 #79c0ff
+
+#: magenta
+color5 #bc8cff
+color13 #d2a8ff
+
+#: cyan
+color6 #39c5cf
+color14 #56d4dd
+
+#: white
+color7 #b1bac4
+color15 #ffffff
diff --git a/kitty/.config/kitty/kitty.conf b/kitty/.config/kitty/kitty.conf
index 8f2db85..d2b3513 100644
--- a/kitty/.config/kitty/kitty.conf
+++ b/kitty/.config/kitty/kitty.conf
@@ -2040,6 +2040,6 @@ map opt+cmd+, debug_config
# BEGIN_KITTY_THEME
-# 3024 Night
+# GitHub Dark
include current-theme.conf
# END_KITTY_THEME
diff --git a/kitty/.config/kitty/kitty.conf.bak b/kitty/.config/kitty/kitty.conf.bak
index 8fff5b3..8f2db85 100644
--- a/kitty/.config/kitty/kitty.conf.bak
+++ b/kitty/.config/kitty/kitty.conf.bak
@@ -7,7 +7,8 @@
#: characters.
# font_family Ubuntu Mono
- font_family JetBrains Mono Nerd Font
+ # font_family JetBrains Mono Nerd Font
+ font_family JetBrains Mono Extra Bold Nerd Font
# font_family DejaVu Mono
# font_family source code pro
# font_family Iosevka Term
@@ -2039,6 +2040,6 @@ map opt+cmd+, debug_config
# BEGIN_KITTY_THEME
-# 1984 Dark
+# 3024 Night
include current-theme.conf
# END_KITTY_THEME
diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua
index e98fbc5..cd7e329 100644
--- a/nvim/.config/nvim/init.lua
+++ b/nvim/.config/nvim/init.lua
@@ -1,6 +1,5 @@
--[[ vim.g.material_style = "palenight" ]]
-
require('onedark').setup {
style = 'deep',
transparent = true,
@@ -23,6 +22,8 @@ require "user.plugins"
require "user.colorscheme"
require "user.cmp"
require "user.lsp"
+require "user.snippets"
+--[[ require "user.luasnip" ]]
require "user.telescope"
require "user.treesitter"
require "user.autopairs"
@@ -41,3 +42,21 @@ require "user.autocommands"
--require "material"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nvim/.config/nvim/lua/user/keymaps.lua b/nvim/.config/nvim/lua/user/keymaps.lua
index 1211057..7e25c15 100644
--- a/nvim/.config/nvim/lua/user/keymaps.lua
+++ b/nvim/.config/nvim/lua/user/keymaps.lua
@@ -1,14 +1,15 @@
local opts = { noremap = true, silent = true }
-local term_opts = { silent = true }
-
-- Shorten function name
local keymap = vim.api.nvim_set_keymap
+--local ls = require "luasnip"
+
--Remap space as leader key
keymap("", "<Space>", "<Nop>", opts)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
+local ls = require "luasnip"
-- Modes
-- normal_mode = "n",
@@ -65,17 +66,22 @@ keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
-- Jumping quickly between two files
keymap("n", "<leader><leader>", ":bprevious<CR>", opts)
--- Compiling code --
--- keymap("n", "<F3>", ":w <CR> :!g++ -fsanitize=address -std=c++17 -Wall -Wextra -Wshadow -DONPC -O2 -o %< % && ./%< <CR>", opts)
--- keymap("n", "<F3>", ":w <CR> :!g++ -fsanitize=address -std=c++17 -Wall -Wextra -Wshadow -DONPC -O2 -o %< % <CR>", opts)
+--CompetiTest
keymap("n", "<F2>", ":CompetiTestReceive<CR>", opts)
keymap("n", "<F3>", ":CompetiTestRun<CR>", opts)
+--sourcing luasnips
+keymap("n", "<leader><leader>s", "<cmd> source ~/.config/nvim/lua/user/luasnip.lua<CR>", opts)
+
+
+-- luasnips
+vim.keymap.set({ "i", "s" }, "<c-k>", function ()
+ print("hello")
+ if ls.expand_or_jumpable then
+ ls.expand_or_jump()end
+end, { silent = false })
+--vim.keymap.set("i", "<c-h>", function () if ls.jumpable(-1) then ls.jump(-1)end end, opts)
--- Terminal --
--- Better terminal navigation
--- keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts)
--- keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts)
--- keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
--- keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
+--keymap("i", "<c-l>", "function () if ls.expand_or_jumpable then ls.expand_or_jump()end end", opts)
+--keymap("i", "<c-h>", "function () if ls.jumpable(-1) then ls.jump(-1)end end", opts)
diff --git a/nvim/.config/nvim/lua/user/lsp/handlers.lua b/nvim/.config/nvim/lua/user/lsp/handlers.lua
index dda229d..2baf039 100644
--- a/nvim/.config/nvim/lua/user/lsp/handlers.lua
+++ b/nvim/.config/nvim/lua/user/lsp/handlers.lua
@@ -99,6 +99,6 @@ if not status_ok then
return
end
-M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities)
+M.capabilities = cmp_nvim_lsp.default_capabilities(capabilities)
return M
diff --git a/nvim/.config/nvim/lua/user/luasnip.lua b/nvim/.config/nvim/lua/user/luasnip.lua
new file mode 100644
index 0000000..ecde02b
--- /dev/null
+++ b/nvim/.config/nvim/lua/user/luasnip.lua
@@ -0,0 +1,43 @@
+local ls = require "luasnip"
+
+local snippet = ls.s
+local f = ls.function_node
+local t = ls.text_node
+local i = ls.insert_node
+
+local shortcut = function(val)
+ if type(val) == "string" then
+ return { t { val }, i(0) }
+ end
+
+ if type(val) == "table" then
+ for k, v in ipairs(val) do
+ if type(v) == "string" then
+ val[k] = t { v }
+ end
+ end
+ end
+
+ return val
+end
+
+local M = {}
+
+M.same = function(index)
+ return f(function(args)
+ return args[1]
+ end, { index })
+end
+
+M.make = function(tbl)
+ local result = {}
+ for k, v in pairs(tbl) do
+ table.insert(result, (snippet({ trig = k, desc = v.desc }, shortcut(v))))
+ end
+
+ return result
+end
+
+
+return M
+
diff --git a/nvim/.config/nvim/lua/user/options.lua b/nvim/.config/nvim/lua/user/options.lua
index 1ad2efa..bf3af7b 100644
--- a/nvim/.config/nvim/lua/user/options.lua
+++ b/nvim/.config/nvim/lua/user/options.lua
@@ -32,7 +32,7 @@ local options = {
wrap = true, -- display lines as one long line
scrolloff = 8, -- is one of my fav
sidescrolloff = 8,
- guifont = "JetBrainsMonoExtraBold Nerd Font:h14", -- the font used in graphical neovim applications
+ guifont = "JetBrainsMonoExtraBold Nerd Font:h10", -- the font used in graphical neovim applications
}
vim.opt.shortmess:append "c"
diff --git a/nvim/.config/nvim/lua/user/plugins.lua b/nvim/.config/nvim/lua/user/plugins.lua
index f646ba5..a147567 100644
--- a/nvim/.config/nvim/lua/user/plugins.lua
+++ b/nvim/.config/nvim/lua/user/plugins.lua
@@ -95,6 +95,7 @@ return packer.startup(function(use)
use "saadparwaiz1/cmp_luasnip" -- snippet completions
use "hrsh7th/cmp-nvim-lsp"
use "windwp/nvim-ts-autotag" --auto close tags
+
-- snippets
use "L3MON4D3/LuaSnip" --snippet engine
use "rafamadriz/friendly-snippets" -- a bunch of snippets to use
diff --git a/nvim/.config/nvim/lua/user/snippets.lua b/nvim/.config/nvim/lua/user/snippets.lua
new file mode 100644
index 0000000..d94d359
--- /dev/null
+++ b/nvim/.config/nvim/lua/user/snippets.lua
@@ -0,0 +1,13 @@
+local ls = require "luasnip"
+
+ls.snippets = {
+ all = {
+ ls.parser.parse_snippet("expand", "-- This is what was expanded --"),
+ },
+ lua = {
+
+ }
+}
+
+
+