{"id":1554,"date":"2006-12-07T22:55:00","date_gmt":"2006-12-07T22:55:00","guid":{"rendered":"http:\/\/gleamynode.net\/articles\/1554\/tabbed-editing-with-gvim-and-nautilus-file-manager"},"modified":"2022-12-28T01:46:46","modified_gmt":"2022-12-27T16:46:46","slug":"tabbed-editing-with-gvim-and-nautilus-file-manager","status":"publish","type":"post","link":"https:\/\/vault.motd.kr\/wordpress\/posts\/1554\/tabbed-editing-with-gvim-and-nautilus-file-manager\/","title":{"rendered":"Tabbed Editing with GViM and Nautilus File Manager"},"content":{"rendered":"
The default text editor of GNOME desktop environment<\/a> is ‘gedit<\/a>‘. I prefer ViM<\/a> because it has much better functionality and customizability, and moreover, it launches faster. One thing I’ve been missing from GViM, a GUI version of ViM, was tabbed editing. GViM already supports tabbed editing, but opening a text file from Nautilus File Manager<\/a> always creates a new window by default.<\/p>\n GNOME \ub370\uc2a4\ud06c\ud0d1 \ud658\uacbd\uc758 \uae30\ubcf8 \ud14d\uc2a4\ud2b8 \ud3b8\uc9d1\uae30\ub294 gedit\uc785\ub2c8\ub2e4. \uc800\ub294 \uae30\ub2a5\ub3c4 \ud6e8\uc52c \ub9ce\uace0 \ucee4\uc2a4\ud130\ub9c8\uc774\uc988\ub3c4 \uc6a9\uc774\ud55c\ub370\ub2e4\uac00 \uc2e4\ud589 \uc18d\ub3c4\ub3c4 \ub354 \ube60\ub978 ViM\uc744 \uc120\ud638\ud569\ub2c8\ub2e4. ViM\uc758 GViM\uc5d0\uc11c \ud55c \uac00\uc9c0 \uc544\uc26c\uc6e0\ub358 \uae30\ub2a5\uc740 \ud0ed \ud3b8\uc9d1 \uae30\ub2a5(\ud0ed \ube0c\ub77c\uc6b0\uc9d5\ucc98\ub7fc \ud0ed\uc73c\ub85c \uc5ec\ub7ec \ubb38\uc11c\ub97c \ud3b8\uc9d1\ud558\ub294 \uae30\ub2a5)\uc785\ub2c8\ub2e4. GViM\uc740 \uc774\ubbf8 \ud0ed \ud3b8\uc9d1 \uae30\ub2a5\uc744 \uc81c\uacf5\ud558\uc9c0\ub9cc Nautilus \ud30c\uc77c \uad00\ub9ac\uc790\uc5d0\uc11c \ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc744 \uc5f4\uba74 \uae30\ubcf8\uc801\uc73c\ub85c \uc0c8 \ucc3d\uc744 \uc5f4\uac8c \ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n Fortunately, I finally found out how to change this behavior. Nautilus stores its file association information in ~\/.local\/share\/applications<\/tt> directory. You can put customized .desktop<\/tt> files there, and then you can associate certain file type to the customized .desktop<\/tt> file. In my case, I want text files to be opened in a new tab of the current GViM window. I put gvim-usercustom.desktop<\/tt> file to ~\/.local\/share\/applications<\/tt> directory:<\/p>\n \uc6b4\uc88b\uac8c\ub3c4 \uc774 \ub3d9\uc791\uc744 \ubc14\uafb8\ub294 \ubc29\ubc95\uc744 \uacb0\uad6d \uc54c\uc544\ub0c8\uc2b5\ub2c8\ub2e4. Nautilus\ub294 \ud30c\uc77c \uc5f0\uacb0 \uc815\ubcf4\ub97c ~\/.local\/share\/applications<\/tt> \ub514\ub809\ud1a0\ub9ac\uc5d0 \uc800\uc7a5\ud569\ub2c8\ub2e4. \uc774 \ub514\ub809\ud1a0\ub9ac\uc5d0 \ucee4\uc2a4\ud130\ub9c8\uc774\uc988\ud55c .desktop<\/tt> \ud30c\uc77c\uc744 \ub123\uace0 \ud2b9\uc815 \ud30c\uc77c \uc720\ud615\uc744 \uadf8 .desktop<\/tt> \ud30c\uc77c\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc81c \uacbd\uc6b0\uc5d0\ub294 \ud604\uc7ac \ub5a0 \uc788\ub294 GViM \ucc3d\uc758 \uc0c8 \ud0ed\uc5d0 \ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc774 \uc5f4\ub9ac\uae30\ub97c \uc6d0\ud558\ub294 \uac83\uc774\uc8e0. \uadf8\ub798\uc11c gvim-usercustom.desktop<\/tt> \ud30c\uc77c\uc744 ~\/.local\/share\/applications<\/tt> \ub514\ub809\ud1a0\ub9ac\uc5d0 \ub123\uc5b4 \uc8fc\uc5c8\uc2b5\ub2c8\ub2e4:<\/p>\n \nIf you prefer other text editor and want to change its default bahavior, you could copy its .desktop<\/tt> file from \/usr\/share\/applications\/<\/tt> and rename it to <appname>-usercustom.desktop<\/tt> and tweak it a little bit. Refering to this document<\/a> will also help you if the application you want to associate with a certain file type isn’t listed in a default setting.<\/p>\n \ub2e4\ub978 \ud3b8\uc9d1\uae30\ub97c \ub354 \uc120\ud638\ud558\uace0 \uadf8 \ud3b8\uc9d1\uae30\uc758 \uae30\ubcf8 \ub3d9\uc791\uc744 \ubc14\uafb8\uace0 \uc2f6\ub2e4\uba74 \/usr\/share\/applications\/<\/tt> \ub514\ub809\ud1a0\ub9ac\uc5d0\uc11c \uadf8 \ud3b8\uc9d1\uae30\uc758 .desktop<\/tt> \ud30c\uc77c\uc744 \ubcf5\uc0ac\ud574 <appname>-usercustom.desktop<\/tt>\uc73c\ub85c \uc774\ub984\uc744 \ubc14\uafb8\uace0 \uc190\uc744 \uc880 \ubcf4\uba74 \ub420 \uac81\ub2c8\ub2e4. \ud2b9\uc815 \ud30c\uc77c \uc720\ud615\uc5d0 \uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \uae30\ubcf8 \uc124\uc815\uc5d0 \ud3ec\ud568\ub418\uc5b4 \uc788\uc9c0 \uc54a\ub2e4\uba74 \uc774 \ubb38\uc11c<\/a>\ub97c \ucc38\uc870\ud558\uba74 \ub3c4\uc6c0\uc774 \ub420 \uac83\uc785\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":" The default text editor of GNOME desktop environment is ‘gedit‘. I prefer ViM because it has much better functionality and customizability, and moreover, it launches faster. One thing I’ve been missing from GViM, a GUI version of ViM, was tabbed editing. GViM already supports tabbed editing, but opening a text file from Nautilus File Manager… Continue reading \n
[Desktop Entry]
\nEncoding=UTF-8
\nName=GVim Text Editor (Tab)
\nComment=Edit text files in a new tab
\nExec=gvim --remote-tab %F
\nTerminal=false
\nType=Application
\nIcon=\/usr\/share\/pixmaps\/vim.svg
\nCategories=Application;Utility;TextEditor;
\nStartupNotify=true
\nMimeType=text\/plain;
\nNoDisplay=true<\/pre>\n<\/blockquote>\n