Skip to content

Commit dec0219

Browse files
committed
add xinitrc
setup dwm basic config customization feat: enable lsp-zero's completion navigation on pmenu with tab and enter as hotkeys in neovim
1 parent 85d739f commit dec0219

File tree

5 files changed

+198
-0
lines changed

5 files changed

+198
-0
lines changed

.config/nvim/after/plugin/lsp.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ require('mason-lspconfig').setup({
2929

3030
local cmp = require('cmp')
3131
local cmp_select = {behavior = cmp.SelectBehavior.Select}
32+
local cmp_action = require("lsp-zero").cmp_action()
33+
cmp.setup({
34+
mapping = {
35+
["<CR>"] = cmp.mapping.confirm({
36+
behavior = cmp.ConfirmBehavior.Replace, select=true
37+
}),
38+
["<Tab>"] = cmp_action.luasnip_supertab(),
39+
["<S-Tab>"] = cmp_action.luasnip_shift_supertab(),
40+
},
41+
42+
--formatting = {
43+
-- format = require("lspkind").cmp_format({mode = "symbol"})
44+
--}
45+
})
46+
3247

3348
cmp.setup({
3449
sources = {

.xinitrc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
userresources=$HOME/.Xresources
4+
usermodmap=$HOME/.Xmodmap
5+
sysresources=/etc/X11/xinit/.Xresources
6+
sysmodmap=/etc/X11/xinit/.Xmodmap
7+
8+
# merge in defaults and keymaps
9+
10+
if [ -f $sysresources ]; then
11+
xrdb -merge $sysresources
12+
fi
13+
14+
if [ -f $sysmodmap ]; then
15+
xmodmap $sysmodmap
16+
fi
17+
18+
if [ -f "$userresources" ]; then
19+
20+
xrdb -merge "$userresources"
21+
22+
fi
23+
24+
if [ -f "$usermodmap" ]; then
25+
xmodmap "$usermodmap"
26+
fi
27+
28+
# start programs
29+
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
30+
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
31+
[ -x "$f" ] && . "$f"
32+
done
33+
unset f
34+
fi
35+
36+
#======DEORICE==========
37+
38+
#Keyboard Layout
39+
#setxkbmap pt-BR &
40+
setxkbmap -model thinkpad -layout br -variant abnt2
41+
42+
#Display Resolution
43+
#xrandr --output Virtual-1 --mode 1920x1000 &
44+
45+
# Compositor
46+
picom -f &
47+
48+
#Wallpapers
49+
nitrogen --restore &
50+
51+
#statusbar date with xsetroot
52+
while true; do
53+
xsetroot -name "$(date)"
54+
sleep 1s #time update every minute
55+
done &
56+
57+
#Execute DWM
58+
exec dwm >> ~/.dwm.log
59+
60+
# Setting PATH for dmenu
61+
#export PATH="~/bin/Discord:${PATH}"
62+
#export PATH="${PATH}:${HOME}/bin/Discord"

wms/dwm/config.h

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/* See LICENSE file for copyright and license details. */
2+
3+
/* appearance */
4+
static const unsigned int borderpx = 1; /* border pixel of windows */
5+
static const unsigned int snap = 32; /* snap pixel */
6+
static const int showbar = 1; /* 0 means no bar */
7+
static const int topbar = 1; /* 0 means bottom bar */
8+
static const char *fonts[] = { "monospace:size=10" };
9+
static const char dmenufont[] = "monospace:size=10";
10+
static const char col_gray1[] = "#222222";
11+
static const char col_gray2[] = "#444444";
12+
static const char col_gray3[] = "#d88c9e";
13+
//default icon tag gray color (when it is not selected): #bbbbbb
14+
static const char col_gray4[] = "#eeeeee";
15+
//default selected icon tag gray colors: "#eeeeee";
16+
// test1: red github icon: #d88c9e
17+
// test2: the cool salmon color: #e25440;
18+
static const char col_cyan[] = "#00a86b";
19+
//default bar color when it has something running in that tag: "#005577";
20+
static const char *colors[][3] = {
21+
/* fg bg border */
22+
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
23+
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
24+
};
25+
26+
/* tagging */
27+
static const char *tags[] = { "", "", "", "", "", "", "", "", "" };
28+
//{ "1", "2", "3", "4", "5", "6", "7", "8", "9" };
29+
30+
static const Rule rules[] = {
31+
/* xprop(1):
32+
* WM_CLASS(STRING) = instance, class
33+
* WM_NAME(STRING) = title
34+
*/
35+
/* class instance title tags mask isfloating monitor */
36+
{ "Gimp", NULL, NULL, 0, 1, -1 },
37+
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
38+
};
39+
40+
/* layout(s) */
41+
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
42+
static const int nmaster = 1; /* number of clients in master area */
43+
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
44+
45+
static const Layout layouts[] = {
46+
/* symbol arrange function */
47+
{ "[]=", tile }, /* first entry is default */
48+
{ "><>", NULL }, /* no layout function means floating behavior */
49+
{ "[M]", monocle },
50+
};
51+
52+
/* key definitions */
53+
#define MODKEY Mod1Mask
54+
#define TAGKEYS(KEY,TAG) \
55+
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
56+
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
57+
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
58+
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
59+
60+
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
61+
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
62+
63+
/* commands */
64+
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
65+
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
66+
static const char *termcmd[] = { "st", NULL };
67+
68+
static Key keys[] = {
69+
/* modifier key function argument */
70+
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
71+
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
72+
{ MODKEY, XK_b, togglebar, {0} },
73+
{ MODKEY, XK_j, focusstack, {.i = +1 } },
74+
{ MODKEY, XK_k, focusstack, {.i = -1 } },
75+
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
76+
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
77+
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
78+
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
79+
{ MODKEY, XK_Return, zoom, {0} },
80+
{ MODKEY, XK_Tab, view, {0} },
81+
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
82+
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
83+
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
84+
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
85+
{ MODKEY, XK_space, setlayout, {0} },
86+
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
87+
{ MODKEY, XK_0, view, {.ui = ~0 } },
88+
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
89+
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
90+
{ MODKEY, XK_period, focusmon, {.i = +1 } },
91+
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
92+
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
93+
TAGKEYS( XK_1, 0)
94+
TAGKEYS( XK_2, 1)
95+
TAGKEYS( XK_3, 2)
96+
TAGKEYS( XK_4, 3)
97+
TAGKEYS( XK_5, 4)
98+
TAGKEYS( XK_6, 5)
99+
TAGKEYS( XK_7, 6)
100+
TAGKEYS( XK_8, 7)
101+
TAGKEYS( XK_9, 8)
102+
{ MODKEY|ShiftMask, XK_q, quit, {0} },
103+
};
104+
105+
/* button definitions */
106+
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
107+
static Button buttons[] = {
108+
/* click event mask button function argument */
109+
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
110+
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
111+
{ ClkWinTitle, 0, Button2, zoom, {0} },
112+
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
113+
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
114+
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
115+
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
116+
{ ClkTagBar, 0, Button1, view, {0} },
117+
{ ClkTagBar, 0, Button3, toggleview, {0} },
118+
{ ClkTagBar, MODKEY, Button1, tag, {0} },
119+
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
120+
};
121+
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)