{"action":"created","issue":{"url":"https://api.github.com/repos/szw/vim-ctrlspace/issues/135","labels_url":"https://api.github.com/repos/szw/vim-ctrlspace/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/szw/vim-ctrlspace/issues/135/comments","events_url":"https://api.github.com/repos/szw/vim-ctrlspace/issues/135/events","html_url":"https://github.com/szw/vim-ctrlspace/issues/135","id":100599946,"number":135,"title":"Workspace Feature Request","user":{"login":"sittim","id":8825037,"avatar_url":"https://avatars.githubusercontent.com/u/8825037?v=3","gravatar_id":"","url":"https://api.github.com/users/sittim","html_url":"https://github.com/sittim","followers_url":"https://api.github.com/users/sittim/followers","following_url":"https://api.github.com/users/sittim/following{/other_user}","gists_url":"https://api.github.com/users/sittim/gists{/gist_id}","starred_url":"https://api.github.com/users/sittim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sittim/subscriptions","organizations_url":"https://api.github.com/users/sittim/orgs","repos_url":"https://api.github.com/users/sittim/repos","events_url":"https://api.github.com/users/sittim/events{/privacy}","received_events_url":"https://api.github.com/users/sittim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/szw/vim-ctrlspace/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-12T18:00:30Z","updated_at":"2015-08-13T21:20:53Z","closed_at":null,"body":"# Challenge\r\n\r\nEvery time I change workspace, I have to remap the <C-b> key, since each workspace requires a workspace specific makefile.\r\n\r\n# Details\r\n\r\nI develop in C++, when I develop a class, let say `RingBuffer`, I have the following files associated with it.\r\n\r\n- `src/ring_buffer.h`\r\n- `src/ring_buffer.cpp`\r\n- `src/unittest/ring_buffer_test.cpp`\r\n- `src/unittest/mock_ring_buffer.h`\r\n- `src/unittest/ring_buffer.makefile`\r\n\r\nWhen I work on the RingBuffer class, I have all these buffers open in windows and I keep the workspace saved.  To work on another class I just switch workspaces.  This saves a ton of time, *but every-time I switch the buffer, I have to update my <C-b> key binding to run shell command such as `make -f src/unittest/ring_buffer.makefile`*.  Is there a solution for such issue?\r\n\r\n# Possible Solution (Sublime Text uses project specific configuration files)\r\n\r\nWould it be possible, in the working directory to create files named `workspace_name.cs_workspace` and allow a user to add stuff like a key binding, for example:\r\n`map <C-b> !make -f src/unittest/ring_buffer.makefile`\r\n\r\n# How Sublime Text does it\r\n\r\nLearning from Sublime Text, they use two files in this case it is for workspace called `resources`,  File Name: `resources.sublime-project`\r\n```js\r\n{\r\n    \"folders\":\r\n    [\r\n        {\r\n            \"follow_symlinks\": true,\r\n            \"path\": \"/work/fw/c1202-f5335\",\r\n            \"folder_exclude_patterns\": [\r\n                \"Debug\",\r\n                \"targetConfigs\"\r\n            ],\r\n            \"file_exclude_patterns\": [\r\n                \"*.ccxml\",\r\n                \"*.plist\",\r\n                \"*_test\",\r\n                \"*.gch\",\r\n                \"*.sublime-workspace\",\r\n                \"*.o\",\r\n                \"*.pp\",\r\n                \"*.obj\"\r\n            ],\r\n            \"follow_symlinks\": true\r\n        }\r\n    ],\r\n    \"settings\":\r\n    {\r\n            \"sublimegdb_workingdir\": \"/work/fw/c1202-f5335/dispatcher/unittest\",\r\n            // NOTE: You MUST provide --interpreter=mi for the plugin to work\r\n            \"sublimegdb_commandline\": \"gdb --interpreter=mi tstamp_test\",\r\n            \"cc_include_options\":\r\n            [\r\n                \"-D _BIC_SR(X)=\",\r\n                \"-D _BIS_SR(X)=\",\r\n                \"-D STACK_LEN=32\",\r\n                \"-D TASK_QTY=4\",\r\n                \"-I/work/fw/c1202-f5335\",\r\n                \"-I/work/gmock/include/\",\r\n                \"-I/work/gmock/gtest/include\",\r\n                \"-isystem\", \"/usr/include\",\r\n                \"-isystem\", \"/usr/lib/llvm-3.6/lib/clang/3.6.2/include\",\r\n                \"-Wall\"\r\n            ]\r\n    },\r\n    \"build_systems\":\r\n    [\r\n        {\r\n            \"name\": \"Resource\",\r\n            \"shell_cmd\": \"make -f resource.makefile && ./resource_test\",\r\n            \"file_regex\": \"^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$\",\r\n            \"working_dir\": \"${file_path}\",\r\n            \"selector\": \"common_test.cpp\"\r\n        },\r\n        {\r\n            \"name\": \"Resource Parent\",\r\n            \"shell_cmd\": \"make -f resource_parent.makefile && ./resource_parent_test\",\r\n            \"file_regex\": \"^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$\",\r\n            \"working_dir\": \"${file_path}\",\r\n            \"selector\": \"common_test.cpp\"\r\n        }\r\n    ]\r\n}\r\n```\r\nThe there is a file named `resources.sublime-workspace`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/szw/vim-ctrlspace/issues/comments/130848129","html_url":"https://github.com/szw/vim-ctrlspace/issues/135#issuecomment-130848129","issue_url":"https://api.github.com/repos/szw/vim-ctrlspace/issues/135","id":130848129,"user":{"login":"szw","id":341899,"avatar_url":"https://avatars.githubusercontent.com/u/341899?v=3","gravatar_id":"","url":"https://api.github.com/users/szw","html_url":"https://github.com/szw","followers_url":"https://api.github.com/users/szw/followers","following_url":"https://api.github.com/users/szw/following{/other_user}","gists_url":"https://api.github.com/users/szw/gists{/gist_id}","starred_url":"https://api.github.com/users/szw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szw/subscriptions","organizations_url":"https://api.github.com/users/szw/orgs","repos_url":"https://api.github.com/users/szw/repos","events_url":"https://api.github.com/users/szw/events{/privacy}","received_events_url":"https://api.github.com/users/szw/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T21:20:53Z","updated_at":"2015-08-13T21:20:53Z","body":"Sure, there is a function in Vim Script named `substitute()` that would work for in this case:\r\n```VimL\r\nsubstitute(\"class_name_unittest.cpp\", \"_unittest.cpp\", \".makefile\", \"\")\r\n```"}}